Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-11995

Reverting a config.remove fails

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Blocker
    • Resolution: Fixed
    • 3.1.0-a1
    • 3.1.0-a2
    • None
    • None

    Description

      I created a migration using the following code:

      array('config.remove', array('news_archive_per_year')),

      On purging/uninstalling, I received the following error:

      Debug:

      [phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/migration/tool/config.php on line 50: Missing argument 2 for phpbb/db/migration/tool/config::add()
      [phpBB Debug] PHP Notice: in file [ROOT]/phpbb/db/migration/tool/config.php on line 57: Undefined variable: config_value

      SQL:

      SQL ERROR [ mysqli ]
       
      Column 'config_value' cannot be null [1048]
       
      SQL
       
      INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('news_archive_per_year', NULL, 0)
       
      BACKTRACE
       
      FILE: (not given by php)
      LINE: (not given by php)
      CALL: msg_handler()
       
      FILE: [ROOT]/phpbb/db/driver/driver.php
      LINE: 811
      CALL: trigger_error()
       
      FILE: [ROOT]/phpbb/db/driver/mysqli.php
      LINE: 189
      CALL: phpbb\db\driver\driver->sql_error()
       
      FILE: [ROOT]/phpbb/config/db.php
      LINE: 166
      CALL: phpbb\db\driver\mysqli->sql_query()
       
      FILE: [ROOT]/phpbb/config/db.php
      LINE: 127
      CALL: phpbb\config\db->set_atomic()
       
      FILE: [ROOT]/phpbb/db/migration/tool/config.php
      LINE: 57
      CALL: phpbb\config\db->set()
       
      FILE: (not given by php)
      LINE: (not given by php)
      CALL: phpbb\db\migration\tool\config->add()
       
      FILE: [ROOT]/phpbb/db/migration/tool/config.php
      LINE: 149
      CALL: call_user_func_array()
       
      FILE: (not given by php)
      LINE: (not given by php)
      CALL: phpbb\db\migration\tool\config->reverse()
       
      FILE: [ROOT]/phpbb/db/migrator.php
      LINE: 459
      CALL: call_user_func_array()
       
      FILE: [ROOT]/phpbb/db/migrator.php
      LINE: 405
      CALL: phpbb\db\migrator->run_step()
       
      FILE: [ROOT]/phpbb/db/migrator.php
      LINE: 326
      CALL: phpbb\db\migrator->process_data_step()
       
      FILE: [ROOT]/phpbb/db/migrator.php
      LINE: 296
      CALL: phpbb\db\migrator->try_revert()
       
      FILE: [ROOT]/phpbb/db/migrator.php
      LINE: 292
      CALL: phpbb\db\migrator->revert()
       
      ...
       
      FILE: [ROOT]/phpbb/db/migrator.php
      LINE: 292
      CALL: phpbb\db\migrator->revert()
       
      FILE: [ROOT]/phpbb/extension/base.php
      LINE: 106
      CALL: phpbb\db\migrator->revert()
       
      FILE: [ROOT]/phpbb/extension/manager.php
      LINE: 347
      CALL: phpbb\extension\base->purge_step()
       
      FILE: [ROOT]/includes/acp/acp_extensions.php
      LINE: 180
      CALL: phpbb\extension\manager->purge_step()
       
      FILE: [ROOT]/includes/functions_module.php
      LINE: 571
      CALL: acp_extensions->main()
       
      FILE: [ROOT]/adm/index.php
      LINE: 71
      CALL: p_master->load_active()

      The problem is that reverting config changes, just renames the function which is called, but add takes 2/3 arguments, while remove only has 1. So we need to force remove to take 2/3 arguments aswell.

      Attachments

        Activity

          People

            nickvergessen Joas Schilling
            nickvergessen Joas Schilling
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: