problems after migrating to php7

  • Martin7
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 9 months ago #2480 by Martin7
problems after migrating to php7 was created by Martin7
hi JoomlaSystems,

after migrating to php7 I have noticed many problem in Joomla causes by the CPtags plugin.

Problem appears with the error message in backend:

"Call to undefined function mysql_escape_string()"

when I try to save article, and other objects from other components (like form of UniForm component) or try to edit other objects.

The developers from JoomlaShine confirmed that the problem is produced by the \plugins\content\cptags\cptags.php plugin.

"Dear Martin,

After investigating, we found out the problem caused by this \plugins\content\cptags\cptags.php

It's using an out date PHP function, and it makes the Joomla Article doesn't work too, please create a new Article then save > the same error appears.

Recommend you to remove this component, or contact the provider to help you fix it.

Thank you :)"

could you please urgently make fix for this problem?

Another question : why this plugin is fired when I create / save / edit non-article objects from other components?

thanks and waiting for for your help !

Martin
The following user(s) said Thank You: kulturgoteborg

Please Log in or Create an account to join the conversation.

More
7 years 9 months ago - 7 years 9 months ago #2481 by andrea_4g
Replied by andrea_4g on topic problems after migrating to php7
Custom Properties is NOT PHP7 ready at this time.
It will take some time to thoroughly test it.

You should revert to previous PHP versions.
Last edit: 7 years 9 months ago by andrea_4g.

Please Log in or Create an account to join the conversation.

  • Martin7
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 9 months ago #2482 by Martin7
Replied by Martin7 on topic problems after migrating to php7
hi Andrea,

thanks for your answer. I am using php7 since some time and look actually not bad - so far CP works and I did not notice any other problem except only this one. Could you please maybe fix just this one problem?

thanks in advance

Marcin
The following user(s) said Thank You: kulturgoteborg

Please Log in or Create an account to join the conversation.

More
7 years 9 months ago #2483 by andrea_4g
Replied by andrea_4g on topic problems after migrating to php7
Hi,
as of now less that 1% of websites is using PHP7, that's why testing and upgrading CP to that version of PHP is not very high in our priorities.

About the problem you are reporting, you can try replacing 'mysql_escape_string' with 'mysql_real_escape_string'.

The plugin is fired when you create / save an article because during the creation of the article you might just be assigning tags, that need to be saved.

Please Log in or Create an account to join the conversation.

  • Martin7
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 9 months ago #2484 by Martin7
Replied by Martin7 on topic problems after migrating to php7
hi Andrea,

thanks for your answer.

1) mysql_real_escape_string is deprecated in php7 as well. I have used mysqli_escape_string in /plugins/content/cptags/cptags.php and it seems to solve this problem.

This function is available since php5 so you could use this change without braking the backwards compatibility with php5

php.net/manual/de/function.mysqli-escape-string.php

Could you please include this into the next release?

2) It seems this plugin is called not only when adding article but when adding ANY kind of object. I have this problem when
- adding new native Joomla article
- adding new Form of the UniForm extension
- adding new category of the Minitek Content Utilities extension.

I would guess CP component is related only to native Joomla article so this plugin should not fire when working with any other Joomla objects.

Could you please investigate the problem this problem?

thanks in advance
Martin

Please Log in or Create an account to join the conversation.

More
7 years 9 months ago #2485 by andrea_4g
Replied by andrea_4g on topic problems after migrating to php7
Thanks for your input.
It will be part of the next release.

About CP being triggered:
Custom Properties plugin is triggered whenever the 'onContentAfterSave' event is fired.
Many components (including several Joomla-native ones, K2, etc) fires this event.

Please Log in or Create an account to join the conversation.

Time to create page: 0.183 seconds