Getting "Unable to use undefined value as ARRAY error" in my KRL code

When I launch the Kynetx application, I get the following error:

Can't use an undefined value as an ARRAY reference at /web/lib/perl/Kynetx/Persistence.pm line 284, <GEN0> line 465. 

My code is as follows:

rule page_loaded is active {
  select when pageview "manticore.*" setting()
  pre {
    savedName = current ent:userName;
  }
  if (savedName neq "") then {
    notify("Hello #{savedName}!!","Welcome back!") with sticky = true;
  }
  notfired {
    raise explicit event name_not_saved_yet;
  }  
}  

I had this code that worked before, but not sure if it is killing it now.

UPDATE: From the debug information.

// 2010/12/07 16:45:31 DEBUG Scheduler.pm a57x4 clear_saved_name Schedule iterator returning email_client with current RID count 0 and current rule count 3
// 2010/12/07 16:45:31 DEBUG Rules.pm a57x4 email_client Rule email_client is active
// 2010/12/07 16:45:31 DEBUG Rules.pm a57x4 email_client [selected] email_client
// 2010/12/07 16:45:31 DEBUG Rules.pm a57x4 email_client
//------------------- begin rule execution: email_client ------------------------
// 2010/12/07 16:45:31 ERROR Rules.pm a57x4 email_client Ruleset a57x4 failed: Can't use an undefined value as an ARRAY reference at /web/lib/perl/Kynetx/Persistence.pm line 284, <GEN0> line 6. 
+3
source share
1 answer

We have changed the way trails are stored. I will fix the bug as soon as possible.

If I show you some secret functions, you need to promise not to speak

for an entity variable, try the syntax (if you have the variable myUserName):

 set ent:userName myUserName

Then for your example, you can write:

pre {
  savedName = ent:userName || "";
}
if (savedName neq "") then ....

I will update this answer by issuing a fix

+3
source

Source: https://habr.com/ru/post/1778861/


All Articles