Quantcast
Channel: phpBB.com
Viewing all articles
Browse latest Browse all 2244

Extension Writers Discussion • Migrations problem - old migration file wants old version of a class that's been replaced

$
0
0
In re-developing RH Topic Tags for phpBB 3.3.x compatibility and a bunch of improvements, I've run into the following problem:

The migrations/release_0_0_8.php file (very old, from the phpBB 3.1.x era) has:

Code:

public function calc_count_tags(){/* @var $auth \phpbb\auth\auth */$auth = $this->container->get('auth');$db_helper = new db_helper($this->db);$config_text = $this->container->get('config_text');$tags_manager = new tags_manager($this->db, $this->config, $config_text, $auth, $db_helper, $this->table_prefix);$tags_manager->calc_count_tags();}
That's calling the tags_manager() class with parameters that no longer match that class's definition.

I don't know why phpBB would be doing anything at all with that migration file, unless it believes it is doing a migration from ver. 0.0.7 of the extension to 0.0.8.

Regardless, in the current migration file, release_3_0_2.php, I overrode that with something that matches how this class actually works now:

Code:

public function calc_count_tags(){/* @var $auth \phpbb\auth\auth */$auth = $this->container->get('auth');$db_helper = new db_helper($this->db);$config_text = $this->container->get('config_text');$tags_manager = new tags_manager($this->db, $this->config, $config_text, $auth, $this->language, $this->user, $db_helper, $this->table_prefix);$tags_manager->calc_count_tags();}
Yet, it's being reported to me that installation of this extension still "dies on contact" with release_0_0_8.php. I really have no idea how to resolve this, other than just nuking all the migrations and re-doing this as "clean-slate install" extension that cannot be migrated from old versions.

Weirdly, I have not been able to locally replicate this problem. I have a dev server with phpBB 3.3.14, and it has my fork of the extension, RH Topic Tags 3.0.2-beta2, working flawlessly in it. Yet at least two others who have tried it have run into the installation problem reported above.

Anyway, the code is at: https://github.com/SMcCandlish/phpBB-ext-RHTopicTags
The main dev/support thread is at: viewtopic.php?t=2661331
The revised release_3_0_2.php (with the code mentioned above) is at https://raw.githubusercontent.com/SMcCa ... _3_0_2.php (it's not part of either of the beta releases, since it seems not to have the intended effect).

Statistics: Posted by SMcCandlish — Mon Mar 24, 2025 9:51 am



Viewing all articles
Browse latest Browse all 2244

Trending Articles