Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-19303 META: XMLDB Editor various bugs/improvements
  3. MDL-31527

XMLDB Editor - misnamed default table for blocks (and probably other types)

    XMLWordPrintable

Details

    • MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • MOODLE_21_STABLE, MOODLE_22_STABLE
    • MDL-31527_xmldb_table_names
    • Hide

      Remember to rename the table

      Show
      Remember to rename the table
    • Hide

      Choose any built-in block which does not currently have any database tables.
      Create a 'db' subfolder for that block and make sure it is writeable by your web server (chmod a+w is a simple, if insecure way of achieving this)
      Open up the XMLDB editor, scroll down to the block and click on 'Create', 'Load', 'Edit' (in that order).
      Expected result:
      Default table is called 'block_XXX' (where XXX is the name of the block)
      Current result:
      Default table is called 'XXX' (just the name of the block)

      Show
      Choose any built-in block which does not currently have any database tables. Create a 'db' subfolder for that block and make sure it is writeable by your web server (chmod a+w is a simple, if insecure way of achieving this) Open up the XMLDB editor, scroll down to the block and click on 'Create', 'Load', 'Edit' (in that order). Expected result: Default table is called 'block_XXX' (where XXX is the name of the block) Current result: Default table is called 'XXX' (just the name of the block)

    Description

      If you are create a block, with no database tables, then use the XMLDB editor to create a install.xml file, the the name of the table will not include the 'block_' prefix (I assume this is the same for other plugin types).

      This wouldn't be a major issue, except that attempting to submit a plugin (or even an updated version of a plugin) to the Moodle.org plugins database will give an unavoidable error if your database block's database tables don't start 'block_'. This is annoying if you are releasing a new plugin (as it involves a whole lot of search and replace) and doubly so if you are trying to release an update (as you then need to add upgrade code to rename the tables as well).

      Attachments

        Activity

          People

            davosmith Davo Smith
            davosmith Davo Smith
            Rajesh Taneja Rajesh Taneja
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Andrew Davis Andrew Davis
            David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              12/Mar/12