Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-76725

php8 wiki error - Unknown named parameter $subwikiid

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 4.0.7, 4.1.2
    • 3.11.11, 4.0.5, 4.0.6, 4.1, 4.1.1
    • Wiki (2.x)
    • PHP 8.0
    • MOODLE_311_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE
    • MOODLE_400_STABLE, MOODLE_401_STABLE
    • MDL-76725-401
    • Hide

      Ensure testing with PHP8

      1. Log in as admin
      2. Create a course
      3. Enable editing mode
      4. Add a Wiki activity
      5. When creating new page select NWiki format
      6. Select Files from Wiki navigation
      7. Press Edit files and upload a picture of your favourite elf
      8. Navigate back to Edit from Wiki navigation
      9. Select your uploaded file from the Insert an image.. field
      10. Press Save
      11. Confirm page is saved without exception, and shows your image
      Show
      Ensure testing with PHP8 Log in as admin Create a course Enable editing mode Add a Wiki activity When creating new page select NWiki format Select Files from Wiki navigation Press Edit files and upload a picture of your favourite elf Navigate back to Edit from Wiki navigation Select your uploaded file from the Insert an image.. field Press Save Confirm page is saved without exception, and shows your image

      Hello,

      we have detected a bug in the Wiki module in Moodle 3.11.11 with the NWiki wiki format (same with Creole format). When uploading and adding an image to the wiki page, the following error occurs: "Exception - Unknown named parameter $subwikiid" and does not allow to save the changes. We have checked that this only happens with php8 (8.0.x), if you switch to php7, the problem disappears. It seems to match the problem of this issue

       

      Stack trace:
      line 336 of /mod/wiki/parser/markups/wikimarkup.php: Error thrown
      line 329 of /mod/wiki/parser/markups/wikimarkup.php: call to wiki_markup_parser->real_path()
      line 241 of /mod/wiki/parser/markups/nwiki.php: call to wiki_markup_parser->format_image()
      line 252 of /mod/wiki/parser/parser.php: call to nwiki_parser->image_tag_rule()
      line ? of unknownfile: call to generic_parser->tag_callback()
      line 237 of /mod/wiki/parser/parser.php: call to preg_replace_callback()
      line 228 of /mod/wiki/parser/parser.php: call to generic_parser->process_tag_rule()
      line 197 of /mod/wiki/parser/parser.php: call to generic_parser->rules()
      line ? of unknownfile: call to generic_parser->block_callback()
      line 177 of /mod/wiki/parser/parser.php: call to preg_replace_callback()
      line 150 of /mod/wiki/parser/parser.php: call to generic_parser->process_block_rule()
      line 60 of /mod/wiki/parser/parser.php: call to generic_parser->parse()
      line 638 of /mod/wiki/locallib.php: call to wiki_parser_proxy::parse()
      line 288 of /mod/wiki/locallib.php: call to wiki_parse_content()
      line 256 of /mod/wiki/locallib.php: call to wiki_refresh_cachedcontent()
      line 2039 of /mod/wiki/pagelib.php: call to wiki_save_page()
      line 1996 of /mod/wiki/pagelib.php: call to page_wiki_save->print_save()
      line 138 of /mod/wiki/edit.php: call to page_wiki_save->print_content()
      

       

      Testing instructions:

      1. Make sure your server are running PHP 8.0.X and Moodle 3.11.11.
      2. Create a new moodle course.
      3. Create a new wiki activity: set format to NWiki (force format) and fill required inputs. Leave all other options default. 
      4. Go to "Wiki  activity / Files"  and upload an image.
      5. Go to "Wiki  activity / Edit" and insert the image you previously uploades from the "Insert an image" dropdown.
      6. Save.
      7. Error "Exception - Unknown named parameter $subwikiid" is displayed.
      8. Expected: Wiki page loads and renders the image.

      Same happens with the Creole Wiki format.

      Regards

        1. 401.gif
          401.gif
          414 kB
        2. master.gif
          master.gif
          462 kB
        3. 400.gif
          400.gif
          624 kB

            pholden Paul Holden
            jmabreu Miguel_
            Amaia Anabitarte Amaia Anabitarte
            Jun Pataleta Jun Pataleta
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 28 minutes
                2h 28m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.