Yo ColdBoxers!
Perhaps it’s because I’ve been working for 12 hours and it’s Friday… Perhaps I’m just loosing brain cells due to gamma rays… I am struggling with a simple task.
The problem
I’m setting some variables into the Flash scope but they are not being inflated into the PRC; however, only event handler is acting up. The following two examples both exist in the same event handler (two different actions)
// Example of working Flash persistence
var errors = prc.FEUSer.getErrorMementos();
flash.put(name=‘SignInErrors’,value=errors,inflateToPRC=true,autoPurge=true);
setNextEvent(url=event.buildLink(linkto=rc.signinPage,ssl=true));
// Example of failing Flash persistence
var flashPackage = {‘values’ = form,‘errors’=errors};
flash.put(name=‘desktop.translations.validateRegistration’,value=flashPackage,inflateToPRC=true,autoPurge=true);
setNextEvent(url=Event.buildLink(‘translations/register’),ssl=true,statusCode=302);
My Findings
The second, failing example is almost working. I’ve traced execution and am finding the “KEEP” value added to the payload Flashed by a developer is being set to false in the failing example but is being set to true in the working example. In the AbstractFlashScope.cfc inflateFlash method, around line 117 (https://github.com/ColdBox/coldbox-platform/blob/master/system/web/flash/AbstractFlashScope.cfc) the framework ignores any persisted values that have a KEEP value of false which skips execution of the code that would set these values into the RC or PRC.
Do you know what I could be doing wrong?
Thanks,
Aaron Greenlee