[3.1][3.2][RC] Prime Post Revision

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Scam Warning
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
RomaamoR
Registered User
Posts: 89
Joined: Tue Feb 24, 2015 4:45 pm
Contact:

Re: [3.1][3.2][RC] Prime Post Revision

Post by RomaamoR » Fri Dec 15, 2017 8:59 pm

Code: Select all

SQL ERROR [ mysqli ]

Table 'vladr546_new.phpbb_ppr' doesn't exist [1146]

SQL

SHOW COLUMNS FROM phpbb_ppr

BACKTRACE

FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()

FILE: [ROOT]/phpbb/db/driver/driver.php
LINE: 999
CALL: trigger_error()

FILE: [ROOT]/phpbb/db/driver/mysqli.php
LINE: 193
CALL: phpbb\db\driver\driver->sql_error()

FILE: [ROOT]/phpbb/db/tools/tools.php
LINE: 885
CALL: phpbb\db\driver\mysqli->sql_query()

FILE: [ROOT]/phpbb/db/tools/tools.php
LINE: 902
CALL: phpbb\db\tools\tools->sql_list_columns()

FILE: [ROOT]/phpbb/db/tools/tools.php
LINE: 541
CALL: phpbb\db\tools\tools->sql_column_exists()

FILE: (not given by php)
LINE: (not given by php)
CALL: phpbb\db\tools\tools->perform_schema_changes()

FILE: [ROOT]/phpbb/db/migrator.php
LINE: 711
CALL: call_user_func_array()

FILE: [ROOT]/phpbb/db/migrator.php
LINE: 658
CALL: phpbb\db\migrator->run_step()

FILE: [ROOT]/phpbb/db/migrator.php
LINE: 400
CALL: phpbb\db\migrator->process_data_step()

FILE: [ROOT]/phpbb/db/migrator.php
LINE: 288
CALL: phpbb\db\migrator->try_apply()

FILE: [ROOT]/phpbb/db/migrator.php
LINE: 241
CALL: phpbb\db\migrator->update_do()

FILE: [ROOT]/phpbb/extension/base.php
LINE: 78
CALL: phpbb\db\migrator->update()

FILE: [ROOT]/phpbb/extension/manager.php
LINE: 190
CALL: phpbb\extension\base->enable_step()

FILE: [ROOT]/includes/acp/acp_extensions.php
LINE: 209
CALL: phpbb\extension\manager->enable_step()

FILE: [ROOT]/includes/functions_module.php
LINE: 676
CALL: acp_extensions->main()

FILE: [ROOT]/adm/index.php
LINE: 82
CALL: p_master->load_active()

andreask
Registered User
Posts: 436
Joined: Fri Feb 27, 2009 6:13 pm
Name: Andreas

Re: [3.1][3.2][RC] Prime Post Revision

Post by andreask » Fri Dec 15, 2017 9:07 pm

When exactly does this happen?
Here is what I am working on right now...
Inactive User Manager for phpBB, Prime post revision 3.1/3.2
Give it a try...
If you would like to buy me a bier ;) for my work I will drink it on a hot summer day and thank you!!!

User avatar
RomaamoR
Registered User
Posts: 89
Joined: Tue Feb 24, 2015 4:45 pm
Contact:

Re: [3.1][3.2][RC] Prime Post Revision

Post by RomaamoR » Fri Dec 15, 2017 9:10 pm

When I turn on the extension.

andreask
Registered User
Posts: 436
Joined: Fri Feb 27, 2009 6:13 pm
Name: Andreas

Re: [3.1][3.2][RC] Prime Post Revision

Post by andreask » Fri Dec 15, 2017 9:12 pm

so the installation is working, but when you 'enable' the it show you this?
Here is what I am working on right now...
Inactive User Manager for phpBB, Prime post revision 3.1/3.2
Give it a try...
If you would like to buy me a bier ;) for my work I will drink it on a hot summer day and thank you!!!

User avatar
RomaamoR
Registered User
Posts: 89
Joined: Tue Feb 24, 2015 4:45 pm
Contact:

Re: [3.1][3.2][RC] Prime Post Revision

Post by RomaamoR » Fri Dec 15, 2017 9:17 pm

Yes

andreask
Registered User
Posts: 436
Joined: Fri Feb 27, 2009 6:13 pm
Name: Andreas

Re: [3.1][3.2][RC] Prime Post Revision

Post by andreask » Fri Dec 15, 2017 9:21 pm

Thanks,

The weird thing is, that I do not have this behavior, I am working on it though!
Here is what I am working on right now...
Inactive User Manager for phpBB, Prime post revision 3.1/3.2
Give it a try...
If you would like to buy me a bier ;) for my work I will drink it on a hot summer day and thank you!!!

User avatar
RomaamoR
Registered User
Posts: 89
Joined: Tue Feb 24, 2015 4:45 pm
Contact:

Re: [3.1][3.2][RC] Prime Post Revision

Post by RomaamoR » Fri Dec 15, 2017 9:24 pm

Ok.

User avatar
spaceace
Registered User
Posts: 1788
Joined: Wed Jan 30, 2008 8:50 pm
Contact:

Re: [3.1][3.2][RC] Prime Post Revision

Post by spaceace » Fri Dec 15, 2017 9:43 pm

andreask wrote:
Fri Dec 15, 2017 9:21 pm
Thanks,

The weird thing is, that I do not have this behavior, I am working on it though!
is it possible that it is not installing with the table prefix that RomaamoR has? but just installing with the default phpbb_ table prefix

andreask
Registered User
Posts: 436
Joined: Fri Feb 27, 2009 6:13 pm
Name: Andreas

Re: [3.1][3.2][RC] Prime Post Revision

Post by andreask » Sun Dec 17, 2017 11:10 pm

spaceace wrote:
Fri Dec 15, 2017 9:43 pm
is it possible that it is not installing with the table prefix that RomaamoR has? but just installing with the default phpbb_ table prefix
But in the two migrations where the db updates it uses the table prefix that is set in phpbb... (it's not hard coded)

Code: Select all

public function update_schema()
	{
return array(
			'add_tables'	=> array(
				$this->table_prefix . 'ppr'	=> array(
					'COLUMNS'	=> array(
						'revision_id'						=> array('UINT', null, 'auto_increment'),
						'post_id'						=> array('UINT', 0),
						'post_subject'						=> array('VCHAR', ''),
						'post_text'						=> array('TEXT', ''),
						'bbcode_uid'						=> array('VCHAR:8', ''),
						'bbcode_bitfield'						=> array('VCHAR:255', ''),
						'post_edit_time'							=> array('TIMESTAMP', 0),
						'post_edit_user'						=> array('UINT', 0),
					),
					'PRIMARY_KEY'	=> 'revision_id',
				),
			),
		);
	}
Here is what I am working on right now...
Inactive User Manager for phpBB, Prime post revision 3.1/3.2
Give it a try...
If you would like to buy me a bier ;) for my work I will drink it on a hot summer day and thank you!!!

User avatar
RomaamoR
Registered User
Posts: 89
Joined: Tue Feb 24, 2015 4:45 pm
Contact:

Re: [3.1][3.2][RC] Prime Post Revision

Post by RomaamoR » Tue Dec 19, 2017 9:26 am

Can conflict with another extension?

andreask
Registered User
Posts: 436
Joined: Fri Feb 27, 2009 6:13 pm
Name: Andreas

Re: [3.1][3.2][RC] Prime Post Revision

Post by andreask » Tue Dec 26, 2017 7:02 pm

This error has nothing to do with conflicts...
It looks like during the installation it does not create the required table.

Could you please
  1. disable ext
  2. delete data of the ext
  3. delete files
  4. just for the fun clean the cache
  5. re upload files of ext
  6. and enable
Here is what I am working on right now...
Inactive User Manager for phpBB, Prime post revision 3.1/3.2
Give it a try...
If you would like to buy me a bier ;) for my work I will drink it on a hot summer day and thank you!!!

User avatar
takufner
Registered User
Posts: 209
Joined: Mon Oct 23, 2006 10:39 am
Location: Rio de Janeiro - Brasil
Name: Prof. Caju
Contact:

Re: [3.1][3.2][RC] Prime Post Revision

Post by takufner » Sat Mar 24, 2018 1:55 am

Hello andreask, thanks for your work. Very good extension :)

I'd like to give my contribution to this extension, since I could spot and fix one SQL error.

The problem arises when someone tries to edit a message that has UTF-8 characters with 4 bytes (like 𝑥). The error is:

Code: Select all

 SQL ERROR [ mysqli ]

Incorrect string value: '\xF0\x9D\x91\xA5' for column 'post_edit_reason' at row 1 [1366]

SQL

INSERT INTO phpbb_ppr (post_edit_user, post_id, post_edit_time, post_subject, post_text, bbcode_uid, bbcode_bitfield, post_edit_reason) VALUES ('2', 170608, 1521856338, 'good title', '<t>Good message with all the 20 characters needed.</t>', '2ueoh2lv', '', 'reason with character 𝑥')

In order to fix, I did the following code changes:

Open /ext/bruninoit/ppr/event/main_listener.php:

Search for:

Code: Select all

    	'post_text'	=> $pa['post_text'],
Replace with:

Code: Select all

    	'post_text'	=> utf8_clean_string($pa['post_text']),
Search for:

Code: Select all

    	'post_edit_reason' => $this->user->lang['PPR_ORIGINAL']
Replace with:

Code: Select all

    	'post_edit_reason' => utf8_clean_string($this->user->lang['PPR_ORIGINAL'])
Search for:

Code: Select all

    	'post_text'	=> $event['data']['message'],
Replace with:

Code: Select all

    	'post_text'	=> utf8_clean_string($event['data']['message']),
Search for:

Code: Select all

    	'post_edit_reason' => $post_edit_reason
Replace with:

Code: Select all

    	'post_edit_reason' => utf8_clean_string($post_edit_reason)
Kind regards,

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

Re: [3.1][3.2][RC] Prime Post Revision

Post by 3Di » Sat Mar 24, 2018 3:30 am

Calling that function for just that stuff is a an overload IMO, the function itself calls the huge confusables.php file.
Not to mention that is not fully Emojis's proof.

Let's see how to solve it instead: convert 4-bytes Unicodes to relatives 3-bytes or a devoted char

Something like that:
preg_replace('/[\x{10000}-\x{10FFFF}]/u', "\xef\xbf\xbd", $pa['post_text'])

The whole range of Emojis/4-bytes unicode are ported each one to one specific UTF8 3-bytes devoted replacement character (�) as per the topic I above linked, in use in many of my works. Simply make a function of that line and use it everywhere you need it.
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

Post Reply

Return to “Extensions in Development”

Who is online

Users browsing this forum: MarkDHamill, Mohammed AlSarsawi, Puchahawa, XCatwomanX and 18 guests