#1151 REST API: Request for contact info from "Inventory Entity" returns Internal server error (500)

1.4
closed-fixed
nobody
None
6
2014-06-16
2014-05-25
Erik Huelsmann
No

On the command line, using Perl's lwp tools, the following request fails:

GET http://localhost/ledgersmb/rest/1.4/inv-upload/Contact/0.json

(same with the request for 0.xml, btw).

The entity id 0 is the "Inventory entity". The issue is this (from the http logs):

Attribute (entity_class) is required at constructor LedgerSMB::Entity::Person::new (defined at LedgerSMB/Entity/Person.pm line 180) line 50
LedgerSMB::Entity::Person::new('LedgerSMB::Entity::Person', 'country_name', 'Afghanistan', 'name', 'P ostgres', 'last_name', 'ostgres', 'control_code', 'A-00002', 'country_id', 4, 'entity_id', 1, 'first_name', 'P') called at LedgerSMB/Entity/Person.pm line 136
LedgerSMB::Entity::Person::get('LedgerSMB::Entity::Person', 1) called at LedgerSMB/REST_Class/Contact.pm line 90
LedgerSMB::REST_Class::Contact::_get_entity('HASH(0xb81308c)', 1) called at LedgerSMB/REST_Class/Contact.pm line 45
LedgerSMB::REST_Class::Contact::get('HASH(0xb81308c)') called at /home/ehuelsmann/lsmb-trunk/rest-handler.pl line 209
LedgerSMB::REST_Handler::ANON() called at /usr/share/perl5/Try/Tiny.pm line 76
eval {...} called at /usr/share/perl5/Try/Tiny.pm line 67
Try::Tiny::try('CODE(0xb8125c4)', 'Try::Tiny::Catch=REF(0xc8615dc)') called at /home/ehuelsmann/lsmb-trunk/rest-handler.pl line 242
LedgerSMB::REST_Handler::process_request() called at /home/ehuelsmann/lsmb-trunk/rest-handler.pl line 246
LedgerSMB::REST_Handler::error_handler('Attribute (entity_class) is required at constructor LedgerSMB...') called at /home/ehuelsmann/lsmb-trunk/rest-handler.pl line 240
LedgerSMB::REST_Handler::ANON('Attribute (entity_class) is required at constructor LedgerSMB...') called at /usr/share/perl5/Try/Tiny.pm line 100
Try::Tiny::try('CODE(0xb8125c4)', 'Try::Tiny::Catch=REF(0xc8615dc)') called at /home/ehuelsmann/lsmb-trunk/rest-handler.pl line 242
LedgerSMB::REST_Handler::process_request() called at /home/ehuelsmann/lsmb-trunk/rest-handler.pl line 171

Discussion

  • Erik Huelsmann
    Erik Huelsmann
    2014-05-25

    • Priority: 5 --> 6
     
  • Chris Travers
    Chris Travers
    2014-06-14

    committing a fix for this, pull request imminent.

     
    Last edit: Chris Travers 2014-06-14
  • Chris Travers
    Chris Travers
    2014-06-16

    • status: open --> closed-fixed