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)

    Details

    • Testing Instructions:
      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)
    • Workaround:
      Hide

      Remember to rename the table

      Show
      Remember to rename the table
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull Master Branch:
      MDL-31527_xmldb_table_names

      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).

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/Mar/12