Something in migrations change in 3.1.10?

Discussion forum for Extension Writers regarding Extension Development.
User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Something in migrations change in 3.1.10?

Post by RMcGirr83 » Wed Oct 19, 2016 9:39 am

Did something change in the migration, or db driver, for 3.1.10? Previously extensions I had written installed fine but now I am getting support tickets for things such as
alex75 wrote:Hi guys...
I have this problem, only with phpbb 3.1.10

Code: Select all

[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/driver.php on line 771: key() expects parameter 1 to be array, null given
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/driver.php on line 771: current() expects parameter 1 to be array, null given
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/driver.php on line 771: Illegal string offset 'FROM'

Fatal error: Only variables can be passed by reference in C:\xampp\htdocs\phpbbstoreit\phpbb\db\driver\driver.php on line 771
and
trilo wrote:I'm also getting a General Error when updating to 1.0.4 (on a test site running 3.1.10).

First I disabled the 1.0.3 extension, and then went in and removed the old directory. Then I uploaded the new stopforumspam directory into the ext/rmcgirr83 folder and attempted to enable the extension. Here's the error I'm seeing:
SQL ERROR [ mysqli ]

Column 'config_value' cannot be null [1048]

SQL

INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('sfs_threshold', NULL, 0)
Not sure what is causing either one but I think it has to do with something in the 3.1.10 files as both extensions installed just fine on 3.1.9.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

User avatar
JimA
Community Team Leader
Community Team Leader
Posts: 7604
Joined: Thu Jul 31, 2008 5:54 am
Location: The Netherlands
Name: Jim Mossing Holsteyn
Contact:

Re: Something in migrations change in 3.1.10?

Post by JimA » Wed Oct 19, 2016 9:48 am

Not sure if it's related, but there's a sticky in this forum about changes in the migrator.
Image Jim Mossing Holsteyn - Community Team Leader
Knowledge Base | Documentation | Board rules

If you're having any questions about the rules/customs of this website, feel free to drop me a PM.

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: Something in migrations change in 3.1.10?

Post by RMcGirr83 » Wed Oct 19, 2016 9:58 am

Yeah I saw that but I have zero if statements in my migrator files.

EDIT: Replacing the db directory of 3.1.10 with that from 3.1.9 and the issue is resolved so yeah something changed and not in a good way.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

User avatar
Marc
Development Team Leader
Development Team Leader
Posts: 5387
Joined: Tue Oct 30, 2007 10:57 pm
Location: Munich, Germany
Name: Marc
Contact:

Re: Something in migrations change in 3.1.10?

Post by Marc » Wed Oct 19, 2016 11:23 am

Can you create a ticket in the tracker including the migrations that trigger this? That will help with tracking this down.

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: Something in migrations change in 3.1.10?

Post by RMcGirr83 » Wed Oct 19, 2016 1:47 pm

Marc wrote:Can you create a ticket in the tracker including the migrations that trigger this? That will help with tracking this down.
Done

https://tracker.phpbb.com/browse/PHPBB3-14831
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

User avatar
MarkDHamill
Registered User
Posts: 3790
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: Something in migrations change in 3.1.10?

Post by MarkDHamill » Wed Oct 26, 2016 8:11 pm

I am having similar issues with my digests extension. See:

viewtopic.php?f=456&t=2354426&start=405#p14541536

The extension installs and uninstalls fine in 3.1.9. It's not obvious to me what's wrong with my migration programs. The depends_on() function is not missing an initial slash, for example.

https://github.com/MarkDHamill/digests/ ... migrations

Any suggestions for debugging these errors?
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

User avatar
Sajaki
Registered User
Posts: 1354
Joined: Mon Mar 02, 2009 1:41 pm
Name: Andreas
Contact:

Re: Something in migrations change in 3.1.10?

Post by Sajaki » Wed Oct 26, 2016 9:35 pm

i had similar errors, and found out that as of 3.1.10, root path must exist in module.exists. see PHPBB3-14703 and commit https://github.com/phpbb/phpbb/commit/5eb493fa86
my fix : https://github.com/Sajaki/RecentTopics/ ... 522fa4b718

User avatar
MarkDHamill
Registered User
Posts: 3790
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: Something in migrations change in 3.1.10?

Post by MarkDHamill » Thu Oct 27, 2016 1:38 am

Thank you. In my migration programs however I don't use the IF or module.exists constructs.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

User avatar
3Di
Former Team Member
Posts: 13686
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Something in migrations change in 3.1.10?

Post by 3Di » Thu Oct 27, 2016 1:47 am

MarkDHamill wrote:Thank you. In my migration programs however I don't use the IF or module.exists constructs.
If I correctly recall you use module.remove though. ;)

example of Sajaki's fix (unverified)
https://github.com/Sajaki/RecentTopics/ ... 8418c3R115

Your migration (3_0_6)
https://github.com/MarkDHamill/digests/ ... hp#L35-L43
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

User avatar
VSE
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 4841
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman
Contact:

Re: Something in migrations change in 3.1.10?

Post by VSE » Thu Oct 27, 2016 3:33 pm

You could try an if construct when removing modules, if they exist.

example:

Code: Select all

array('if', array(
    array('module.exists', array('acp', false, 'ACP_PAGES')),
    array('module.remove', array('acp', false, 'ACP_PAGES')),
)),
 
Dictated but not read.
Official phpBB Extensions My Extensions & MODs
Please do not PM me for support.

User avatar
MarkDHamill
Registered User
Posts: 3790
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: Something in migrations change in 3.1.10?

Post by MarkDHamill » Thu Oct 27, 2016 5:26 pm

VSE, I will try your suggestion.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

User avatar
MarkDHamill
Registered User
Posts: 3790
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: Something in migrations change in 3.1.10?

Post by MarkDHamill » Sun Oct 30, 2016 2:44 pm

On my 3.1.10 development instance, I added to my release_3_0_2.php program the following:

Code: Select all

	public function revert_data()
	{
		return 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')),
			),
			'if', array(
				array('module.exists', array('ucp', 'UCP_DIGESTS', 'UCP_DIGESTS_POST_FILTERS')),
				array('module.remove', array('ucp', 'UCP_DIGESTS', 'UCP_DIGESTS_POST_FILTERS')),
			),
			'if', array(
				array('module.exists', array('ucp', 'UCP_DIGESTS', 'UCP_DIGESTS_FORUMS_SELECTION')),
				array('module.remove', array('ucp', 'UCP_DIGESTS', 'UCP_DIGESTS_FORUMS_SELECTION')),
			),
			'if', array(
				array('module.exists', array('ucp', 'UCP_DIGESTS', 'UCP_DIGESTS_BASICS')),
				array('module.remove', array('ucp', 'UCP_DIGESTS', 'UCP_DIGESTS_BASICS')),
			),
			'if', array(
				array('module.exists', array('ucp', false, 'UCP_DIGESTS')),
				array('module.remove', array('ucp', false, 'UCP_DIGESTS')),
			),
		);
	}
This seems the appropriate program to add this logic if there is an issue with the migration logic changing with 3.1.10 since this is also where the modules are added inupdate_data():

Code: Select all

			// Add the UCP digests category, a top level category
			array('module.add', array(
				'module_class'		=> 'ucp',
				'module_basename'	=>	false,	// 0, or top level
				'module_langname'	=> 'UCP_DIGESTS',
				'module_auth'       => 'ext_phpbbservices/digests',
			)),
			// Add the four UCP digest modules
			array('module.add', array(
				'ucp', 
				'UCP_DIGESTS', 
				array(
					'module_basename'   => '\phpbbservices\digests\ucp\main_module',
					'modes' => array('basics', 'forums_selection', 'post_filters', 'additional_criteria'),
				),
			)),
The extension now installs fine but when deleting data the following error occurs:
Catchable fatal error: Argument 1 passed to phpbb\db\migrator::get_callable_from_step() must be of the type array, string given, called in /Applications/XAMPP/xamppfiles/apps/phpbb/htdocs/phpbb/db/migrator.php on line 581 and defined in /Applications/XAMPP/xamppfiles/apps/phpbb/htdocs/phpbb/db/migrator.php on line 603
Basically the UCP modules are not deleted because of the failure of this step. The parent and module (2nd and 3rd) parameters are correct. Any idea what's triggering this?

If I comment out the revert_data() function the delete data completes seemingly without error but these UCP modules and the category are not removed.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

User avatar
david63
Registered User
Posts: 16093
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Something in migrations change in 3.1.10?

Post by david63 » Sun Oct 30, 2016 2:51 pm

@Mark - there is a known bug in 3.1.10 when deleting data from some extensions which should be fixed in 3.1.11

I would not waste much time on trying to fix something that may not be a problem.
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
MarkDHamill
Registered User
Posts: 3790
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: Something in migrations change in 3.1.10?

Post by MarkDHamill » Sun Oct 30, 2016 4:24 pm

That was my thought too except I feel like I shouldn't release anything until 3.1.11 is released. Hopefully the wait won't be too long.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

User avatar
VSE
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 4841
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman
Contact:

Re: Something in migrations change in 3.1.10?

Post by VSE » Sun Oct 30, 2016 10:13 pm

Why doing this?

Code: Select all

array('module.add', array(
   'module_class'      => 'ucp',
   'module_basename'   =>   false,   // 0, or top level
   'module_langname'   => 'UCP_DIGESTS',
   'module_auth'       => 'ext_phpbbservices/digests',
)),
Try:

Code: Select all

array('module.add', array(
   'ucp',
   false,
   'UCP_DIGESTS',
)),
Dictated but not read.
Official phpBB Extensions My Extensions & MODs
Please do not PM me for support.

Post Reply

Return to “Extension Writers Discussion”

cron