-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in DataManager Class - Array to string Conversion #12
Comments
What version of the application are you using and what version of PHP are you using? |
@JonDeG |
TraceLog E:\PPNew\environment\classes\dataaccess\DataManager.class.php:findOne()
E:\PPNew\environment\classes\dataaccess\DataManager.class.php:find():begin
E:\PPNew\environment\classes\dataaccess\DataManager.class.php:find():SELECT * FROM `pp088_config_options` WHERE `name` = 'theme'
E:\PPNew\environment\classes\dataaccess\DataManager.class.php:find():found 1
E:\PPNew\environment\classes\dataaccess\DataManager.class.php:loadFromRow(row):begin
E:\PPNew\environment\classes\dataaccess\DataManager.class.php:isReady() = class_exists ConfigOption
E:\PPNew\environment\classes\controller\PageController.class.php:tpl_fetch(E:/PPNew/application/views/administration/browse_log.php)
E:\PPNew\application\helpers\company_website.php:administration_tabbed_navigation
E:\PPNew\application\models\PluginManager.class.php:call_user_func_array(times_add_administration_tab,..
E:\PPNew\environment\classes\controller\PageController.class.php:renderLayout(E:/PPNew/application/layouts/administration.php <xmp><div class="advancedPagination">
<a href="/index.php?c=administration&a=browse_log&active_project=2&1421037759&trace&pos=0&dir=">First page</a>
<a href="/index.php?c=administration&a=browse_log&active_project=2&1421037759&trace&pos=3217576&dir=up">Previous page</a>
Page: 3221672 <a href="/index.php?c=administration&a=browse_log&active_project=2&1421037759&trace&pos=3221672&dir=">Next page</a>
<a href="/index.php?c=administration&a=browse_log&active_project=2&1421037759&trace&pos=-1&dir=up">Last page</a></div>
------------------------------------------------------------------
<br>Session "default" started at 2015-01-11T09:19:02+0000
<br>#1 ERROR: Error: Array to string conversion in 'E:\PPNew\environment\classes\dataaccess\DataManager.class.php' on line 252 (error code: 8)
<br>#2 ERROR: Error: Array to string conversion in 'E:\PPNew\environment\classes\dataaccess\DataManager.class.php' on line 342 (error code: 8)
<br>#3 ERROR: Error: Array to string conversion in 'E:\PPNew\environment\classes\dataaccess\DataManager.class.php' on line 390 (error code: 8)
<br>#4 ERROR: Error: Array to string conversion in 'E:\PPNew\environment\classes\dataaccess\DataManager.class.php' on line 396 (error code: 8)
<br>Time since start: 0.26563096046448 seconds
<br>-------------------------------------------------------------------------------
<br>Session "default" started at 2015-01-11T09:21:40+0000
<br>#1 ERROR: Error: Array to string conversion in 'E:\PPNew\environment\classes\dataaccess\DataManager.class.php' on line 252 (error code: 8)
<br>#2 ERROR: Error: Array to string conversion in 'E:\PPNew\environment\classes\dataaccess\DataManager.class.php' on line 342 (error code: 8)
<br>#3 ERROR: Error: Array to string conversion in 'E:\PPNew\environment\classes\dataaccess\DataManager.class.php' on line 390 (error code: 8)
<br>#4 ERROR: Error: Array to string conversion in 'E:\PPNew\environment\classes\dataaccess\DataManager.class.php' on line 396 (error code: 8)
<br>Time since start: 0.28125691413879 seconds
<br>-------------------------------------------------------------------------------
<br>Session "default" started at 2015-01-11T09:21:46+0000
<br>#1 ERROR: Error: Array to string conversion in 'E:\PPNew\environment\classes\dataaccess\DataManager.class.php' on line 252 (error code: 8)
<br>#2 ERROR: Error: Array to string conversion in 'E:\PPNew\environment\classes\dataaccess\DataManager.class.php' on line 342 (error code: 8)
<br>#3 ERROR: Error: Array to string conversion in 'E:\PPNew\environment\classes\dataaccess\DataManager.class.php' on line 390 (error code: 8)
<br>#4 ERROR: Error: Array to string conversion in 'E:\PPNew\environment\classes\dataaccess\DataManager.class.php' on line 396 (error code: 8)
<br>Time since start: 0.26563191413879 seconds
<br>-------------------------------------------------------------------------------
<br>Session "default" started at 2015-01-12T04:42:28+0000
<br>#1 ERROR: Error: Array to string conversion in 'E:\PPNew\application\controllers\AccessController.class.php' on line 133 (error code: 8)
<br>Time since start: 0.40625500679016 seconds
<br>-------------------------------------------------------------------------------
<br>Session "default" started at 2015-01-12T04:42:29+0000
<br>#1 ERROR: Error: Array to string conversion in 'E:\PPNew\environment\classes\dataaccess\DataManager.class.php' on line 252 (error code: 8)
<br>#2 ERROR: Error: Array to string conversion in 'E:\PPNew\environment\classes\dataaccess\DataManager.class.php' on line 342 (error code: 8)
<br>#3 ERROR: Error: Array to string conversion in 'E:\PPNew\environment\classes\dataaccess\DataManager.class.php' on line 390 (error code: 8)
<br>#4 ERROR: Error: Array to string conversion in 'E:\PPNew\environment\classes\dataaccess\DataManager.class.php' on line 396 (error code: 8)
<br>Time since start: 2.296905040741 seconds
<br>-------------------------------------------------------------------------------
<br>Session "default" started at 2015-01-12T04:42:35+0000
<br>#1 ERROR: Error: Array to string conversion in 'E:\PPNew\environment\classes\dataaccess\DataManager.class.php' on line 252 (error code: 8)
<br>#2 ERROR: Error: Array to string conversion in 'E:\PPNew\environment\classes\dataaccess\DataManager.class.php' on line 342 (error code: 8)
<br>#3 ERROR: Error: Array to string conversion in 'E:\PPNew\environment\classes\dataaccess\DataManager.class.php' on line 390 (error code: 8)
<br>#4 ERROR: Error: Array to string conversion in 'E:\PPNew\environment\classes\dataaccess\DataManager.class.php' on line 396 (error code: 8)
<br>Time since start: 0.46875309944153 seconds
<br>-------------------------------------------------------------------------------
<br></xmp>)
E:\PPNew\environment\classes\dataaccess\DataManager.class.php:findOne()
E:\PPNew\environment\classes\dataaccess\DataManager.class.php:find():begin
E:\PPNew\environment\classes\dataaccess\DataManager.class.php:find():SELECT * FROM `pp088_config_options` WHERE `name` = 'site_name'
E:\PPNew\environment\classes\dataaccess\DataManager.class.php:find():found 1
E:\PPNew\environment\classes\dataaccess\DataManager.class.php:loadFromRow(row):begin
E:\PPNew\environment\classes\dataaccess\DataManager.class.php:isReady() = class_exists ConfigOption
E:\PPNew\environment\classes\dataaccess\DataManager.class.php:findOne()
E:\PPNew\environment\classes\dataaccess\DataManager.class.php:find():begin
E:\PPNew\environment\classes\dataaccess\DataManager.class.php:find():SELECT * FROM `pp088_config_options` WHERE `name` = 'theme'
E:\PPNew\environment\classes\dataaccess\DataManager.class.php:find():found 1
E:\PPNew\environment\classes\dataaccess\DataManager.class.php:loadFromRow(row):begin
E:\PPNew\environment\classes\dataaccess\DataManager.class.php:isReady() = class_exists ConfigOption
E:\PPNew\environment\classes\dataaccess\DataManager.class.php:findOne()
E:\PPNew\environment\classes\dataaccess\DataManager.class.php:find():begin |
Does it work if you enable or disable TRACE @ login? __TRACE__ |
Looks like a PHP 5.4+ change that is not backward compatible: http://php.net/manual/en/migration54.incompatible.php specifically: "Converting an array to a string will now generate an E_NOTICE level error, but the result of the cast will still be the string "Array"." I can confirm I have duplicated this on PHP 5.5. This error is logged in the PP system log, but I don't think it's affecting the functionality as it appears to be related to trace logging only. Obviously we need to dig around and find the source. I suspect the variable $id is an array and is the source of the issue. Just a gut feeling at this point. |
FIXI fixed this bug by replacing the double quotes with single quotes in the problem Trace statements in For example here is the modified version of function findById:
The trace strings that contain variable names with $ signs require modification. |
Hi @GLHowell , |
@GLHowell I still get the errors even after making the suggested change. Can you confirm this? When verifying, please directly evaluate the contents of log.php instead of relying on the log browser within the application. Thanks. |
I inspect log.php directly. I delete it and have it regenerated before tests. Turns out, I found two additional files with the problematic trace calls. Perhaps the reported errors you are seeing are from these files? Change the strings with $ in the trace calls in these file as well. There may be other files, that my app hasn't hit yet. If you are still seeing errors from DataManager, recheck your fixes. |
Hi
Facing some issue in DataManger Class "Array to string Conversion" Issue, Please help
The text was updated successfully, but these errors were encountered: