Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Debug class error in 1.8
  • Dear friends
    I'm having an error when trying show the content of any object class (model_xxx). When I invoke the method dump() my program generate an error:

    Undefined offset:2
    at line 255 from fuel/core/classes/debug.php

    What is the cause of error??? Looking any sugestions..
    TIA

    Medeiros
  • HarroHarro
    Accepted Answer
    Any object?

    Just used:

            $model = \Model\Position::find($id, array('related' => array('amount')));
            \Debug::dump($model);die();

    and that worked fine here.
  • HarroHarro
    Accepted Answer
    What PHP version are you running?

    What is result of:

    var_dump(extension_loaded('xdebug'));
    var_dump(ini_get('xdebug.overload_var_dump'));

    and of

    var_dump($your-object-here);
  • Harro,

    I'm sorry for delay in response, I insert the code sugested in my class and I have the follow result:

    C:\projects\fuel\app\classes\controller\admin\registries.php:502:
    boolean true
    C:\projects\fuel\app\classes\controller\admin\registries.php:503:string '2' (length=1)
    C:\projects\fuel\app\classes\controller\admin\registries.php:504:
    object(Model_Registry)[32]
    protected '_is_new' => boolean false
    protected '_frozen' => boolean false
    protected '_sanitization_enabled' => boolean false
    protected '_data' =>
    array (size=25)
    'id' => string '186' (length=3)
    'candidate_id' => string '234' (length=3)
    'job_id' => string '111' (length=3)
    'pcd_request' => string 'N' (length=1)
    'pcd_accept' => null
    'pcd_reject_cause' => null
    'free_request' => string 'Y' (length=1)
    'free_accept' => null
    'nis' => string '1.234.567.890-1' (length=15)
    'quota_request' => string 'N' (length=1)
    'quota_accept' => null
    'quota_reject_cause' => null
    'quota_id' => string '0' (length=1)
    'gru_id' => string '167828' (length=6)
    'gru_doc' => string '0002659848' (length=10)
    'gru_tax' => string '172.50' (length=6)
    'gru_status' => string 'EM_ABERTO' (length=9)
    'pay_date' => null
    'pay_tax' => null
    'pay_storage_date' => null
    'code' => null
    'situation' => null
    'reject_cause' => null
    'created_at' => string '1464642963' (length=10)
    'updated_at' => string '1464643154' (length=10)
    protected '_custom_data' =>
    array (size=0)
    empty
    protected '_original' =>
    array (size=25)
    'id' => string '186' (length=3)
    'candidate_id' => string '234' (length=3)
    'job_id' => string '111' (length=3)
    'pcd_request' => string 'N' (length=1)
    'pcd_accept' => null
    'pcd_reject_cause' => null
    'free_request' => string 'Y' (length=1)
    'free_accept' => null
    'nis' => string '1.234.567.890-1' (length=15)
    'quota_request' => string 'N' (length=1)
    'quota_accept' => null
    'quota_reject_cause' => null
    'quota_id' => string '0' (length=1)
    'gru_id' => string '167828' (length=6)
    'gru_doc' => string '0002659848' (length=10)
    'gru_tax' => string '172.50' (length=6)
    'gru_status' => string 'EM_ABERTO' (length=9)
    'pay_date' => null
    'pay_tax' => null
    'pay_storage_date' => null
    'code' => null
    'situation' => null
    'reject_cause' => null
    'created_at' => string '1464642963' (length=10)
    'updated_at' => string '1464643154' (length=10)
    protected '_data_relations' =>
    array (size=0)
    empty
    protected '_original_relations' =>
    array (size=0)
    empty
    protected '_reset_relations' =>
    array (size=0)
    empty
    protected '_disabled_events' =>
    array (size=0)
    empty
    protected '_view' => null
    protected '_iterable' =>
    array (size=0)
    empty
  • I'm using the FuelPHP 1.8 in wamp server 64bits version  (php 5.6.16, apache 2.4.17).
    All functions is working perfectly... only very strange error reported..
  • HarroHarro
    Accepted Answer
    What does

    var_dump(ini_get('html_errors'));

    return?

    And could you paste all results here: http://bin.fuelphp.com, because the Debug class parses the output and the forum has a way of mangling it when you paste it.
  • HarroHarro
    Accepted Answer
    Forget it, found the problem, it's in the "overload_var_dump" value. The docs state "Before Xdebug 2.4, the default value of this setting was 1." which is what the code uses.
  • HarroHarro
    Accepted Answer
    Fixed: https://github.com/fuel/core/commit/4ab25139b769a6438b7e77c3457f953b1f6b3d08

    Fix will be part of the 1.8.0.1 hotfix due in the next few days.
  • Thank you Mr Haro.
    I have tested the same class in other version of PHP (other version of Wamp, previous version) and I dont have any problem. I'm very happy with your support.
    TIA

    Medeiros
  • Applied the patch, and the Debug show perfectly the expected results.
    Thank you

  • You're welcome. Thanks for reporting the issue.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion