[ic] There was an error adding the order to the transaction table. It was: Not a GLOB reference at /opt/interchange-master/lib/Vend/Table/Common.pm line 1080.

Stefan Hornburg (Racke) racke at linuxia.de
Fri Mar 30 08:17:37 UTC 2018


On 03/30/2018 10:04 AM, Gert van der Spoel wrote:
>> On 03/26/2018 11:36 PM, Gert van der Spoel wrote:
>>> Hi,
>>>
>>>
>>>
>>> I’m trying to run an Interchange site using interchange-master and I’m
>> running into issues trying to make an order.
>>>
>>> The site is using a pretty standard etc/log_transaction file.
>>>
>>> Finalizing the order results in the following error:
>>>
>>> “There was an error adding the order to the transaction table. It was:
>>> Not a GLOB reference at /opt/interchange-
>> master/lib/Vend/Table/Common.pm line 1080.”
>>>
>>>
>>>
>>> This happens for transaction and orderline tables.
>>>
>>>
>>>
>>> Now if I change the lib/VendTable/Common.pm with the following diff then
>> it does pass:
>>>
>>> 1080c1080
>>>
>>> <                                             open(IN, "+<", \$infile)
>>>
>>> ---
>>>
>>>>                                             open(IN, '+<', $infile)
>>>
>>>
>>>
>>> For reference:
>>> https://github.com/interchange/interchange/blob/master/lib/Vend/Table/
>>> Common.pm
>>>
>>>
>>>
>>> I don’t know if this has anything to do with the newer Perl version or
>>> that there is some other glitch somewhere. As I’ve kinda been out of
>>> Perl for the past 10 years, I hope someone here with more recent Perl
>> experience could shine a light on this.
>>>
>>>
>>>
>>> Now after making this change it does pass, but then I end up with the
> next
>> error:
>>>
>>> “import into orderline failed: DBD::mysql::st execute failed: Column
>>> \'store_id\' cannot be null at /opt/interchange-
>> master/lib/Vend/Table/DBI.pm line 1593, <IN> chunk 2.”
>>>
>>
>> Hello Gert,
>>
>> looks like you don't set a value for store_id in your [import] block.
> [import]
>> behaves pretty stupid as it tries to set fields even if you don't pass
> them inside.
>>
>> Regards
>>           Racke
> 
> 
> Hi Stefan,
> 
> Thanks for checking! 
> I also thought at first that this was the problem, even though (like in the
> strap/standard demos) the store_id is set as:
> store_id: __STORE_ID__
> 
> Even without the STORE_ID Variable it should not be null, just empty.
> 
> I think the base of the problem already lies in the lib/Vend/Common.pm ...
> Aparently you all can use the code 'as is', but in my case I need to change
> line 1080 ... I am only not so sure what's the big difference between using
> \$infile instead of $infile and what could cause it to crash for me, but not
> for yours/Jon's ... Do you have any thoughts on that?

Hello Gert,

my thoughts are that these import routines in Interchange are opaque, complex
and hard to tackle.

You could try wellwell's [import-lite] tag:

https://github.com/interchange/wellwell/blob/master/code/import_lite.tag

Regards
          Racke

> 
> Thanks!
> 
> Gert
> 
> 
> 
>>>
>>>
>>> This seems to be because the following set_row code is not passing on
> the
>> correct data:
>>>
>>>      NOTES => <<EndOfRoutine,
>>>
>>>         while (<IN>) {
>>>
>>>             chomp;
>>>
>>>                 \@fields = ();
>>>
>>>                 s/\\r?\\n\\r?\\n((?s:.)*)//
>>>
>>>                      and \$fields[$idx] = \$1;
>>>
>>>                 while(s!($codere):[ \\t]*(.*)\\n?!!) {
>>>
>>>                      next unless defined \$field_hash->{\$1};
>>>
>>>                      \$fields[\$field_hash->{\$1}] = \$2;
>>>
>>>                 }
>>>
>>>                 $index
>>>
>>>                 $numeric_guess
>>>
>>>             \$out->set_row(\@fields);
>>>
>>>                 $numeric_clean
>>>
>>>         }
>>>
>>>
>>>
>>> Does anybody have any good ideas/pointers why this might be happening?
>>>
> 
> 
> _______________________________________________
> interchange-users mailing list
> interchange-users at icdevgroup.org
> http://www.icdevgroup.org/mailman/listinfo/interchange-users
> 


-- 
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.



More information about the interchange-users mailing list