[ic] Error with Tag->data in actionmap after upgrade to Centos 7.4 mysql 5.7.21

Andrew Baerg andrew at pullingshots.ca
Mon Mar 12 03:12:44 UTC 2018


On 2018-03-11 12:13 PM, Peter wrote:
> On 12/03/18 03:53, Andrew Baerg wrote:
>> On 2018-03-11 03:46 AM, Peter wrote:
>>> On 11/03/18 13:52, Andrew Baerg wrote:
>>>> I don't think there is any way to use $Tag->data in an ActionMap 
>>>> without AllowGlobal.
>>> Ummm, see my previous responses where I gave three different ways
>>> to make it work.
>>
>> Right, sorry for not noting that.
>>
>> But I don't see any way to use $Tag->data directly in an ActionMap
>> sub defined on the catalog level the way Andy had without setting
>> AllowGlobal for the catalog.
> 
> ...because two of the three ways I mentioned involve doing just that and
> should work.
> 
> The issue is that the data tag needs access to the db table and hence
> the table itself must be pulled into the Safe container space before
> this can happen.  Sometimes it works to do $Tag->perl('tablename'), but
> since this code itself has to run in a Safe container it often times
> fails (as it is for the OP).  When this doesn't work then it is required
> to pull the tablename in outside of the safe space which is done by
> running the perl tag as ITL either ahead of the code that includes
> $Tag->data() or surrounding it as in these two examples:
> 
> AutoLoad <<EOA
> [perl tablename][/perl]
> EOA
> Actionmap foo <<EOA
> sub {
>     $Tag->data(..);
>     ...
> }
> EOA
> 
> 
> ...or...
> 
> 
> Actionmap foo <<EOA
> [perl tablename]
>     $Tag->data(...);
>     ...
> [/perl]
> EOA
> 
> ...either one of the above should work with a catalog-level Actionmap.

Thanks for the explanation!

In case it helps anyone else, it doesn't seem to matter which tablename you put into the perl ITL, so if you stick the following in your catalog.cfg you can use $Tag->data for any table in all ActionMap subs and [calc] blocks.

AutoLoad [perl products][/perl]

On a side note, it seems strange to me that catalog UserTag subs can use the $Tag->data without any issue. The code must run in a slightly different Safe container I suppose.

Cheers!

Andrew

-- 
https://github.com/pullingshots ... https://metacpan.org/author/BAERGAJ



More information about the interchange-users mailing list