All add-ons currently require PHP 7.4 or greater.

On July 4th 2024 PHP 8.2 will be the new minimum requirement for all add-ons. Expect any add-on released after that date to require 8.2 or greater. Some releases may not immediately take advantage of 8.x specific features in PHP, which means you might, be able to continue using new releases in PHP 7.4, however, if you experience an error the first thing you should do is update to PHP 8.2 then create a support ticket if the error persists.

Please read about the changes to BoldMinded add-on licensing.

Ticket: Depreciated EE function calls causing 100’s SQL calls to developer log

Status Resolved
Add-on / Version
Severity Trivial
EE Version 31

Peter Lewis

Jul 17, 2013

I’ve got an old site that was taking over a minute to load the edit/new entries page, and been working through updating all the add-ons to try and resolve.

Originally there were 1831 queries with hundreds of SQL calls relating to developer logs (mostly SELECT). I’ve managed to eliminate most of these (down to 229 queries now) and it looks like Blueprints is the only culprit left.

Edit: Ticket doesn’t seem to want to save the version numbers - Blueprints v2.0.6 and EE v2.6.1

The developer log issues (shown in SQL output in Control Panel when access New Entry) start with this one…

SELECT *
FROM (`exp_developer_log`)
WHERE `function` =  'remove_double_slashes()'
AND `line` =  185
AND `file` =  '/home/stgecare/eecms-addons/blueprints/helper.blueprints.php'
AND `deprecated_since` =  '2.6'
AND `use_instead` =  'reduce_double_slashes()'
ORDER BY `log_id` desc

Then…

SELECT *
FROM (`exp_developer_log`)
WHERE `function` =  'generate_json()'
AND `line` =  537
AND `file` =  '/home/stgecare/eecms-addons/blueprints/ext.blueprints.php'
AND `deprecated_since` =  '2.6'
AND `use_instead` =  'the native JSON extension (json_encode())'
ORDER BY `log_id` desc

Then probably over 100 SQL calls immediately afterwards looking identical…

SELECT *
FROM (`exp_developer_log`)
WHERE `function` =  ‘generate_json()’
AND `line` =  801
AND `file` =  ‘/home/stgecare/eecms/codeigniter/system/libraries/Javascript.php’
AND `deprecated_since` =  ‘2.6’
AND `use_instead` =  ‘the native JSON extension (json_encode())’
ORDER BY `log_id` desc

#1

BoldMinded (Brian)

Thanks. I’ll try to get this updated soon. As for the excessive queries, thats EllisLab’s fault. They way they implemented this developer log is pretty poor… it shouldn’t be as loud as it is.

#2

BoldMinded (Brian)

To fix this now just search the blueprints folder for $this->EE->functions->remove_double_slashes( and replace it with reduce_double_slashes(

#3

Peter Lewis

Thanks, it’s the JSON issue that seems to be generating all the SQL calls, and yep definitely poor implementation from EE side.

#4

BoldMinded (Brian)

I’m going to close this ticket since it includes a patch. The next release will have the fix included. Thanks for reporting it!

#5

Peter Lewis

Sorry, the fix doesn’t remove any of the SQL calls that are causing a problem. Is there any way to resolve the JSON call issue?

Both Matrix and Playa had exactly the same problem, but once they were updated to the EE 2.6 compatible versions it resolved the issue.

#6

BoldMinded (Brian)

There are 2 instances of

this->EE->javascript->generate_json(

find and replace them with

json_encode(

#7

BoldMinded (Brian)

Dont forget the $

$this->EE->javascript->generate_json

#8

Peter Lewis

Magic - thank you. Now loads in 0.4 seconds and with 157 queries in total (no developer log messages).

Login to reply