Welcome Guest, Not a member yet? Register   Sign In
[split] object_to_array ... (CodeIgniter 3.1.3 Released)
#1

(This post was last modified: 01-11-2017, 08:25 PM by ciadmin.)

There have also apparently been changes in the loader that aren't mentioned in the upgrade notes.  After upgrading I'm getting the following:

Call Stack
# Time Memory Function Location
1 0.0014 280072 {main}( ) ...\index.php:0
2 0.0070 354896 require_once( 'C:\wamp64\www\danceminder2\codeigniter3\system\core\CodeIgniter.php' ) ...\index.php:321
3 0.1601 4651136 call_user_func_array:{C:\wamp64\www\danceminder2\codeigniter3\system\core\CodeIgniter.php:532} ( ) ...\CodeIgniter.php:532
4 0.1601 4654024 DanceMinder->index( ) ...\CodeIgniter.php:532
5 0.4210 6956592 MX_Loader->view( ) ...\Danceminder.php:297
A PHP Error was encountered

Severity: Error
Message: Call to undefined method MY_Loader::_ci_object_to_array()
Filename: MX/Loader.php
Line Number: 299

I'll post more once I've had a chance to debug and figure out where things are going wrong.
Reply
#2

@michaelh99

I guess, within the class MX_Loader you need to find $this->_ci_object_to_array($vars) and to replace it with $this->_ci_prepare_view_vars($vars)
Reply
#3

(01-09-2017, 04:42 PM)michaelh99 Wrote: There have also apparently been changes in the loader that aren't mentioned in the upgrade notes.  After upgrading I'm getting the following:

Call Stack
# Time Memory Function Location
1 0.0014 280072 {main}( ) ...\index.php:0
2 0.0070 354896 require_once( 'C:\wamp64\www\danceminder2\codeigniter3\system\core\CodeIgniter.php' ) ...\index.php:321
3 0.1601 4651136 call_user_func_array:{C:\wamp64\www\danceminder2\codeigniter3\system\core\CodeIgniter.php:532} ( ) ...\CodeIgniter.php:532
4 0.1601 4654024 DanceMinder->index( ) ...\CodeIgniter.php:532
5 0.4210 6956592 MX_Loader->view( ) ...\Danceminder.php:297
A PHP Error was encountered

Severity: Error
Message: Call to undefined method MY_Loader::_ci_object_to_array()
Filename: MX/Loader.php
Line Number: 299

I'll post more once I've had a chance to debug and figure out where things are going wrong.

Yes, there are changes in CI_Loader.
But they are internal, and we don't do instructions for internal changes.

(01-09-2017, 06:11 PM)startbbs Wrote: I am using 4.0 version

You're an idiot.

(01-09-2017, 09:00 PM)skunkbad Wrote: Upgrade from 3.1.2 to 3.1.3 now has broken database sessions for me. Getting this in the logs:

ERROR - 2017-01-09 19:55:20 --> Severity: Warning --> Unknown: Failed to write session data (user). Please verify that the current setting of session.save_path is correct (ci_sessions) Unknown 0

Any ideas? This was fully functional until the upgrade. If I switch to file based sessions it starts working again.

There are 2 bugfixes in 3.1.3 against the Session library, both targeting the database driver:

https://github.com/bcit-ci/CodeIgniter/issues/4916
https://github.com/bcit-ci/CodeIgniter/issues/4923

However, I don't see how either of them could cause another issue.

(01-10-2017, 02:42 AM)gard_olsen Wrote: I am having issues when loading Object to view.

How it's triggered            
PHP Code:
$this->load->view('test/test_view',$objectWithPropertiestrue); 


Code:
A PHP Error was encountered
Severity: Notice

Message: Undefined variable: object

Filename: core/Loader.php

Line Number: 1381

Backtrace:

File: /var/www/test/ci/application/controllers/Test.php
Line: 285
Function: view

File: /var/www/test/htdocs/index.php
Line: 292
Function: require_once

Indeed, this is a valid issue that we haven't noticed.
The patch was written for a security issue reported privately and as such was published only with the final release, leaving no time for public testing. It was reviewed by the reporter, but we've only tested it with arrays.

https://github.com/bcit-ci/CodeIgniter/pull/4975
Reply
#4

gard_olsen
See https://github.com/bcit-ci/CodeIgniter/pull/4975
Reply
#5

(This post was last modified: 01-10-2017, 06:17 AM by rejoan.)

Getting following error after upgrading from 3.1.2 to 3.1.3

Code:
( ! ) Fatal error: Call to undefined method MY_Loader::_ci_object_to_array() in C:\xampp\htdocs\pothdekhun\application\third_party\MX\Loader.php on line 300

Code:
Message: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\pothdekhun\application\third_party\MX\Loader.php:300)

and

Code:
Message: Call to undefined method MY_Loader::_ci_object_to_array()

Filename: MX/Loader.php

Line Number: 300

Any fixes for this?
The largest Bengali tutorial site on Web Development in this planet
Reply
#6

(01-09-2017, 04:42 PM)michaelh99 Wrote: There have also apparently been changes in the loader that aren't mentioned in the upgrade notes.  After upgrading I'm getting the following:

Call Stack
# Time Memory Function Location
1 0.0014 280072 {main}( ) ...\index.php:0
2 0.0070 354896 require_once( 'C:\wamp64\www\danceminder2\codeigniter3\system\core\CodeIgniter.php' ) ...\index.php:321
3 0.1601 4651136 call_user_func_array:{C:\wamp64\www\danceminder2\codeigniter3\system\core\CodeIgniter.php:532} ( ) ...\CodeIgniter.php:532
4 0.1601 4654024 DanceMinder->index( ) ...\CodeIgniter.php:532
5 0.4210 6956592 MX_Loader->view( ) ...\Danceminder.php:297
A PHP Error was encountered

Severity: Error
Message: Call to undefined method MY_Loader::_ci_object_to_array()
Filename: MX/Loader.php
Line Number: 299

I'll post more once I've had a chance to debug and figure out where things are going wrong.

In MX/Loader.php Replace return $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return)); with return $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $this->_ci_prepare_view_vars($vars), '_ci_return' => $return));
Reply
#7

(01-10-2017, 12:16 PM)frocco Wrote:
(01-09-2017, 04:42 PM)michaelh99 Wrote: There have also apparently been changes in the loader that aren't mentioned in the upgrade notes.  After upgrading I'm getting the following:

Call Stack
# Time Memory Function Location
1 0.0014 280072 {main}( ) ...\index.php:0
2 0.0070 354896 require_once( 'C:\wamp64\www\danceminder2\codeigniter3\system\core\CodeIgniter.php' ) ...\index.php:321
3 0.1601 4651136 call_user_func_array:{C:\wamp64\www\danceminder2\codeigniter3\system\core\CodeIgniter.php:532} ( ) ...\CodeIgniter.php:532
4 0.1601 4654024 DanceMinder->index( ) ...\CodeIgniter.php:532
5 0.4210 6956592 MX_Loader->view( ) ...\Danceminder.php:297
A PHP Error was encountered

Severity: Error
Message: Call to undefined method MY_Loader::_ci_object_to_array()
Filename: MX/Loader.php
Line Number: 299

I'll post more once I've had a chance to debug and figure out where things are going wrong.

In MX/Loader.php Replace return $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return)); with return $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $this->_ci_prepare_view_vars($vars), '_ci_return' => $return));

Woahh thanks man! wiredesignz should update their repository right away with this fix Smile
Just a random guy from Internet
Reply
#8

Sorry for the lack of a reply, life got busy around here after I posted my question.  Thank you frocco, that change worked perfectly.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB