#1152 REST API: Request for contact info from "Employee"-type contact fails with ISE

1.4
closed-works-for-me
Chris Travers
None
6
2014-09-02
2014-05-25
Erik Huelsmann
No

On the command line, using Perl's lwp tools, the following request returns an Internal Server Error (ISE):

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

(the same applies for the request for 1.xml). '1' is the id of an employee.

From the http logs, this is the problem:

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(0xbc1108c)', 1) called at LedgerSMB/REST_Class/Contact.pm line 45
LedgerSMB::REST_Class::Contact::get('HASH(0xbc1108c)') 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(0xbc105c4)', 'Try::Tiny::Catch=REF(0xcc5f5dc)') 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(0xbc105c4)', 'Try::Tiny::Catch=REF(0xcc5f5dc)') 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

  • Chris Travers
    Chris Travers
    2014-06-14

    Confirmed, and working on it.

     
  • Chris Travers
    Chris Travers
    2014-08-28

    • assigned_to: Chris Travers
     
  • Chris Travers
    Chris Travers
    2014-08-28

    I am having some issues with Apache 2.4 config as well here.

     
  • Chris Travers
    Chris Travers
    2014-09-02

    this may have been fixed some time ago. With a workaround for rest and apache 2.4 I get the json as expected

     
  • Chris Travers
    Chris Travers
    2014-09-02

    • status: open --> closed-works-for-me