phpBB Installer Bug With Trash Bin MOD

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
User avatar
Leinad4Mind
Translator
Posts: 852
Joined: Sun Jun 01, 2008 11:08 pm
Contact:

phpBB Installer Bug With Trash Bin MOD

Post by Leinad4Mind »

Hi there, I've found a problem converting 3.0.x boards with Trash Bin MOD installed.

I've check that Trash Bin MOD install those 4 columns on phpbb3_posts:
post_deleted_from, post_deleted_user, post_deleted_time and post_deleted_reason.

phpBB 3.1 incorporate a SoftDelete system. And it was added new columns named:
post_visibility, post_delete_user, post_delete_time and post_delete_reason

And I've check all files from 3.1.11 installation and even 3.2.1 installation and I discover the following:

That there is a file on the updater (v310) that will Convert an OLD MOD:
* Migration to convert the Soft Delete MOD for 3.0
*
* https://www.phpbb.com/customise/db/mod/soft_delete/
And this .php file that convert this, is messing with all people that have TrashBin MOD instead of SoftDelete MOD and try to upgrade.

So, I guess phpBB should have a system that would detect if SoftDelete MOD is really installed or TrashBin, and convert it accordingly. Or atleast don't run that code if SoftDeleted MOD is not installed!

And people with TrashBin doesn't even have the option to choose to not run that convert option that is ruining everything...

And I was going to download SoftDelete so I can see which columns that mod use, but I can't open the page of the MOD. It gives me: " PHP Warning: in file [ROOT]/phpbb/di/container_builder.php "

Best Regards

PS: Ofc, I've a quick solution as rename those columns temporarely before the upgrade. And then rename them again so I can run some SQL code, to convert TrashBin to phpBB 3.1 SoftDelete System. But it would be WAY better that phpBB help people out on this, and not creating this issue.
Want to access all my portuguese MOD and Extension translations?
Become my Patreon!
phpBB Portugal Translator and Moderator
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52018
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: phpBB Installer Bug With Trash Bin MOD

Post by Brf »

phpBB 3.2 does not support the mods from 3.0. You are supposed to uninstall all of the mods before upgrading.
User avatar
Leinad4Mind
Translator
Posts: 852
Joined: Sun Jun 01, 2008 11:08 pm
Contact:

Re: phpBB Installer Bug With Trash Bin MOD

Post by Leinad4Mind »

If that was true, then why there is a "Migration to convert the Soft Delete MOD for 3.0" :lol:

If we've that convertion, we should have too for TrashBin, why one is the favorite son? :mrgreen:
Want to access all my portuguese MOD and Extension translations?
Become my Patreon!
phpBB Portugal Translator and Moderator
User avatar
Mick
Support Team Member
Support Team Member
Posts: 22545
Joined: Fri Aug 29, 2008 9:49 am
Location: Cardiff

Re: phpBB Installer Bug With Trash Bin MOD

Post by Mick »

If it were possible to write an upgrader/updater to handle all scenarios it would probably kill any server it was run on. Apart from that it would take thousands of man hours to maintain. At the end of it, mods and extensions are supported by their respective authors from wherever you obtained them.
"The more connected we get the more alone we become" - Kyle Broflovski©
User avatar
Leinad4Mind
Translator
Posts: 852
Joined: Sun Jun 01, 2008 11:08 pm
Contact:

Re: phpBB Installer Bug With Trash Bin MOD

Post by Leinad4Mind »

I understand that. Ofc its not possible to convert them all. And it doesn't make sense.

I just think that the installer should not have at all the SoftDelete MOD Converter, since it is creating a bug on this case I reported. But if phpbb dev team want to keep it, at least, they could fix it just to not be runned when trash bin is detected. Or just if soft deleted is really been detected. ;)

I guess its better to report this on the tracker, right?
Want to access all my portuguese MOD and Extension translations?
Become my Patreon!
phpBB Portugal Translator and Moderator
User avatar
Leinad4Mind
Translator
Posts: 852
Joined: Sun Jun 01, 2008 11:08 pm
Contact:

Re: phpBB Installer Bug With Trash Bin MOD

Post by Leinad4Mind »

Btw, just to be sure about the bug here.

I'm checking the class:

Code: Select all

	public function effectively_installed()
	{
		return !$this->db_tools->sql_column_exists($this->table_prefix . 'posts', 'post_deleted');
	}
And the class that will detect if Soft Delete MOD is installed checks for phpbb3_post.post_deleted

But TrashBin doesn't have that column just have those:

Code: Select all

		'permission_add' => array(
			array('f_delete_forever', 0),
			array('f_undelete', 0),
			array('m_delete_forever', 1),
			array('m_undelete', 1),
		),

		'table_column_add' => array(
			array(TOPICS_TABLE, 'topic_deleted_from', array('UINT', 0)),
			array(TOPICS_TABLE, 'topic_deleted_user', array('UINT', 0)),
			array(TOPICS_TABLE, 'topic_deleted_time', array('TIMESTAMP', 0)),
			array(TOPICS_TABLE, 'topic_deleted_reason', array('VCHAR', '')),

			array(POSTS_TABLE, 'post_deleted_from', array('UINT', 0)),
			array(POSTS_TABLE, 'post_deleted_user', array('UINT', 0)),
			array(POSTS_TABLE, 'post_deleted_time', array('TIMESTAMP', 0)),
			array(POSTS_TABLE, 'post_deleted_reason', array('VCHAR', '')),
		),
Something is odd... because this was runned in my database, because only the post_deleted_time dissappeared, and it shouldnt if that class effectively_installed was really working:

Code: Select all

	public function update_schema()
	{
		return array(
			'drop_columns'		=> array(
				$this->table_prefix . 'forums'			=> array('forum_deleted_topic_count', 'forum_deleted_reply_count'),
				$this->table_prefix . 'posts'			=> array('post_deleted', 'post_deleted_time'),
				$this->table_prefix . 'topics'			=> array('topic_deleted', 'topic_deleted_time', 'topic_deleted_reply_count'),
			),
		);
	}
Maybe this: 'posts', 'post_deleted'); it is checking with any of post_deleted_xyz column?

PS: I'll dig deeper...
Last edited by Leinad4Mind on Mon Sep 25, 2017 9:29 pm, edited 1 time in total.
Want to access all my portuguese MOD and Extension translations?
Become my Patreon!
phpBB Portugal Translator and Moderator
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52018
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: phpBB Installer Bug With Trash Bin MOD

Post by Brf »

Leinad4Mind wrote:
Mon Sep 25, 2017 9:01 pm
the installer should not have at all the SoftDelete MOD Converter
I am guessing that is because 3.1 and 3.2 have a Soft Delete functionality builtin, so it makes sense to upgrade that mod. Neither 3.1 nor 3.2 have a "Trash Bin", so it would not upgrade that mod.
User avatar
Leinad4Mind
Translator
Posts: 852
Joined: Sun Jun 01, 2008 11:08 pm
Contact:

Re: phpBB Installer Bug With Trash Bin MOD

Post by Leinad4Mind »

TrashBin have an SoftDelete system too. But let keep focus on whats matter should we :P

Code: Select all

return !$this->db_tools->sql_column_exists($this->table_prefix . 'posts', 'post_deleted');
That line above is from the public function effectively_installed() on soft_delete_mod_convert.php

Shouldn't this NOT have the ! (not) operator? For what I understood, if that class returns true, it will skip that migration. So basically if post_deleted not exists, it will run that migration file, but it should ONLY run if the post_deleted existed! Because that means the SoftDelete MOD is installed.

Am I right? Or very very wrong? :?
Want to access all my portuguese MOD and Extension translations?
Become my Patreon!
phpBB Portugal Translator and Moderator
User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 17254
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: phpBB Installer Bug With Trash Bin MOD

Post by DavidIQ »

You’re very wrong. That line just means the migration won’t run if the column doesn’t exist. Also I’m not sure this is anything we should look at fixing since it’s a 3.1 migration.
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.
User avatar
Leinad4Mind
Translator
Posts: 852
Joined: Sun Jun 01, 2008 11:08 pm
Contact:

Re: phpBB Installer Bug With Trash Bin MOD

Post by Leinad4Mind »

the migration won’t run if the column doesn’t exist
EXACTLY! That's why the bug exist :lol:

If the column doesn't exist = SoftDeleted MOD is Not installed on the 3.0 board

If the column exist = SoftDeleted MOD IS installed on the 3.0 board

And the migration file should be runned when SoftDeleted MOD IS installed.

And the migration should not run when is NOT installed. :mrgreen:

This migration file will drop_columns on the update_schema, and it will delete the post_deleted_time when SoftDeleted MOD is not installed, since it will run when the column "post_delete" doesn't exist. Basically, it isnt converting SoftDeleteMOD and if we've TrashBin, it will delete the "post_deleted_time" column x'D
Also I’m not sure this is anything we should look at fixing since it’s a 3.1 migration.
Well, this doesn't happen just on 3.1. It happens on 3.2 installer when upgrading from 3.0.
But the problem is on the v310 migration folder... In any case a 3.2.1 file seems to have this bug.
Want to access all my portuguese MOD and Extension translations?
Become my Patreon!
phpBB Portugal Translator and Moderator
User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 17254
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: phpBB Installer Bug With Trash Bin MOD

Post by DavidIQ »

Leinad4Mind wrote:
Tue Sep 26, 2017 1:04 am
the migration won’t run if the column doesn’t exist
EXACTLY! That's why the bug exist :lol:

If the column doesn't exist = SoftDeleted MOD is Not installed on the 3.0 board

If the column exist = SoftDeleted MOD IS installed on the 3.0 board

And the migration file should be runned when SoftDeleted MOD IS installed.

And the migration should not run when is NOT installed. :mrgreen:
I'm not really sure what you're saying here since you're basically contradicting yourself. The migration isn't supposed to run at all since it is specific to Soft Delete. Not sure why you think it should run even if the column doesn't exist.
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.
User avatar
Leinad4Mind
Translator
Posts: 852
Joined: Sun Jun 01, 2008 11:08 pm
Contact:

Re: phpBB Installer Bug With Trash Bin MOD

Post by Leinad4Mind »

Because this is not an normal "MOD" upgrade installation.
This migration is for a conversion. It will convert the MOD to the 3.1 Soft Delete System.

And the update_schema is this:

Code: Select all

public function update_schema()
	{
		return array(
			'drop_columns'		=> array(
				$this->table_prefix . 'forums'			=> array('forum_deleted_topic_count', 'forum_deleted_reply_count'),
				$this->table_prefix . 'posts'			=> array('post_deleted', 'post_deleted_time'),
				$this->table_prefix . 'topics'			=> array('topic_deleted', 'topic_deleted_time', 'topic_deleted_reply_count'),
			),
		);
	}
It is just droping columns... So... why it will drop columns if the MOD doesn't exist? Does that make sense? It doesnt make sense to me at all! If it was adding columns, it was all ok, but this is not a normal case scenario.
Want to access all my portuguese MOD and Extension translations?
Become my Patreon!
phpBB Portugal Translator and Moderator
User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 17254
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: phpBB Installer Bug With Trash Bin MOD

Post by DavidIQ »

You do understand that the dropping of those columns won’t happen if the post_deleted column doesn’t exist right?
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.
User avatar
Leinad4Mind
Translator
Posts: 852
Joined: Sun Jun 01, 2008 11:08 pm
Contact:

Re: phpBB Installer Bug With Trash Bin MOD

Post by Leinad4Mind »

Im not sure... I'll do more tests...

because I've done 3 tests with databases with trashbin installed.
the database didnt have the post_deleted column, just post_deleted_time, post_deleted_reason, post_deleted_user, and the post_deleted_time was removed. I'll try to figure out why that happens.

I'll need to do more tests, I'll be back with more news concerning this, because there is a problem for sure... if it is not from this function then it comes from somewhere else. ;)
Want to access all my portuguese MOD and Extension translations?
Become my Patreon!
phpBB Portugal Translator and Moderator
User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 17254
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: phpBB Installer Bug With Trash Bin MOD

Post by DavidIQ »

A possibility is that update_schema might be getting run even if effectively_installed returns true. So if you’re going to investigate then that might be a good place to start.
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.
Post Reply

Return to “[3.2.x] Support Forum”