migrations/release_3.0.2_data.php
on line 33 change:Code: Select all
$helper = new common();
Code: Select all
global $phpbb_container;
$language = $phpbb_container->get('language');
$helper = new common($language);
migrations/release_3.0.2_data.php
on line 33 change:Code: Select all
$helper = new common();
Code: Select all
global $phpbb_container;
$language = $phpbb_container->get('language');
$helper = new common($language);
/migration/convert_mod_data.php
. However, this affects only those who have a database with tables and data from the digest mod that will be upgraded. On line 45 replace:Code: Select all
$helper = new common();
Code: Select all
global $phpbb_container;
$language = $phpbb_container->get('language');
$helper = new common($language);
Maybe this is what's causing your modules not getting deleted: https://tracker.phpbb.com/browse/PHPBB3-15595MarkDHamill wrote: ↑Sat Apr 21, 2018 5:38 pm There are issues with old modules not deleting that I am still puzzling through.
ACP_DIGEST_SETTINGS
definitely exists in the modules table, as does ACP_CAT_GENERAL
.Code: Select all
<?php
/**
*
* @package phpBB Extension - Digests
* @copyright (c) 2018 Mark D. Hamill ([email protected])
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace phpbbservices\digests\migrations;
class convert_mod_modules extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
$sql = 'SELECT module_id
FROM ' . $this->table_prefix . "modules
WHERE module_class = 'acp'
AND module_langname = 'ACP_DIGESTS_TEST'"; // This module is new with the extension so if exists, there are no modules to convert
$result = $this->db->sql_query($sql);
$module_id = $this->db->sql_fetchfield('module_id');
$this->db->sql_freeresult($result);
return $module_id == false;
}
static public function depends_on()
{
return array('\phpbb\db\migration\data\v31x\v319');
}
public function update_data()
{
return array(
// ----- Remove old ACP Modules ----- //
array('if', array(
array('module.exists', array('acp', 'ACP_DIGEST_SETTINGS', 'ACP_DIGEST_GENERAL_SETTINGS')),
array('module.remove', array('acp', 'ACP_DIGEST_SETTINGS', 'ACP_DIGEST_GENERAL_SETTINGS')),
)),
array('if', array(
array('module.exists', array('acp', 'ACP_DIGEST_SETTINGS', 'ACP_DIGEST_USER_DEFAULT_SETTINGS')),
array('module.remove', array('acp', 'ACP_DIGEST_SETTINGS', 'ACP_DIGEST_USER_DEFAULT_SETTINGS')),
)),
array('if', array(
array('module.exists', array('acp', 'ACP_DIGEST_SETTINGS', 'ACP_DIGEST_EDIT_SUBSCRIBERS')), // Appeared in 2.2.16
array('module.remove', array('acp', 'ACP_DIGEST_SETTINGS', 'ACP_DIGEST_EDIT_SUBSCRIBERS')),
)),
array('if', array(
array('module.exists', array('acp', 'ACP_DIGEST_SETTINGS', 'ACP_DIGEST_BALANCE_LOAD')), // Appeared in 2.2.22
array('module.remove', array('acp', 'ACP_DIGEST_SETTINGS', 'ACP_DIGEST_BALANCE_LOAD')),
)),
array('if', array(
array('module.exists', array('acp', 'ACP_DIGEST_SETTINGS', 'ACP_DIGEST_MASS_SUBSCRIBE_UNSUBSCRIBE')), // Appeared in 2.2.25
array('module.remove', array('acp', 'ACP_DIGEST_SETTINGS', 'ACP_DIGEST_MASS_SUBSCRIBE_UNSUBSCRIBE')),
)),
array('if', array(
array('module.exists', array('acp', 'ACP_CAT_GENERAL', 'ACP_DIGEST_SETTINGS')),
array('module.remove', array('acp', 'ACP_CAT_GENERAL', 'ACP_DIGEST_SETTINGS')),
)),
// ----- Remove UCP modules ----- //
array('if', array(
array('module.exists', array('ucp', 'UCP_DIGESTS', 'UCP_DIGESTS_BASICS')),
array('module.remove', array('ucp', 'UCP_DIGESTS', 'UCP_DIGESTS_BASICS')),
)),
array('if', array(
array('module.exists', array('ucp', 'UCP_DIGESTS', 'UCP_DIGESTS_POSTS_SELECTION')), // Only in 2.2.6, gone in 2.2.7
array('module.remove', array('ucp', 'UCP_DIGESTS', 'UCP_DIGESTS_POSTS_SELECTION')),
)),
array('if', array(
array('module.exists', array('ucp', 'UCP_DIGESTS', 'UCP_DIGESTS_FORUMS_SELECTION')), // Appeared in 2.2.7
array('module.remove', array('ucp', 'UCP_DIGESTS', 'UCP_DIGESTS_FORUMS_SELECTION')),
)),
array('if', array(
array('module.exists', array('ucp', 'UCP_DIGESTS', 'UCP_DIGESTS_POST_FILTERS')),
array('module.remove', array('ucp', 'UCP_DIGESTS', 'UCP_DIGESTS_POST_FILTERS')),
)),
array('if', array(
array('module.exists', array('ucp', 'UCP_DIGESTS', 'UCP_DIGESTS_ADDITIONAL_CRITERIA')),
array('module.remove', array('ucp', 'UCP_DIGESTS', 'UCP_DIGESTS_ADDITIONAL_CRITERIA')),
)),
array('if', array(
array('module.exists', array('ucp', false, 'UCP_DIGESTS')),
array('module.remove', array('ucp', false, 'UCP_DIGESTS')),
)),
);
}
}
Code: Select all
// This module is new with the extension so if exists, there are no modules to convert
$module_id == false
, so if the module does not exist, your migration is effectively installed and thus being skipped. I think you want to return $module_id != false
here.module.remove
checks it for you and silently skips if it doesn't exist. Technically, for the migration code you posted, you don't need the effectively_installed()
method at all.ACP_CAT_MODS
. ACP_CAT_DOT_MODS
, which is the Extensions tab.config.php
file to make sure you have the correct table prefix. In the example below, phpbb_
is assumed for the table prefix.config.php
file will indicate the database name.DELETE FROM phpbb_modules WHERE module_langname LIKE '%DIGEST%'