Quote from: sottwell at Jan 09, 2015, 07:03 AMsaveChroniclePreProcessor is a separate snippet that you have in your HTML before the FormIt snippet? Or is it a FormIt preHook?
If it's a FormIt preHook, then FormIt has to be running, with its properties available to it in its 'config' array, in order to know what code (.php file or snippet) to run as a preHook.
$this->formit->loadHooks('pre',$this->config);
So a preHook cannot provide a value for a FormIt property, which properties have to already be available in order to run the preHook.
Yes, I've said it before, saveChroniclePreProcessor is a separate snippet that I have in my HTML before the FormIt snippet.
I put a band-aid on the problem by writing a new post processor that redirects using the form field grow_id, however, I want to know why the parser is failing to parse the placeholder. This could be a serious core bug or it could just be the way FormIt is using the parse method at line 300 in core/components/formit/model/formit/fihooks.class.php
Quote from: BobRay at Jan 09, 2015, 05:53 AMIt's a little tricky, but you can set up a good editor to let you debug the MODX code as it's running. IOW, you can run the code, line by line, and watch the values of every variable at every point. With luck, you could put a breakpoint in the saveChronical code and step a line at a time from there.
You can see the MODX placeholders and $scriptProperties arrays and you can trace right into FormIt.
It can be extremely time-consuming, but it's pretty much guaranteed to show you what's happening if you keep at it. Sometimes, there's nothing else you can do.
I started tracing on this bug and as far as I got was to the parse method and it appears that $this->modx->parser->processElementTags('',$redirectParams,true,true); is not parsing the placeholder correctly. I don't know enough about that method enough yet to say why it fails or if it's invoked incorrectly or something else is wrong but I will use the band-aid I made till I get free time to do deeper tracing as you describe.
UPDATE: At this point I know that prior to $this->modx->parser->processElementTags('',$redirectParams,true,true); the value of $redirectParams is '{"id":"[[!+grow.id]]"}' and after the parser runs the value of $redirectParams is '{"id":""}'.
Bob, could you give me an example of what you mean by out-puting the placeholder at the moment before line 300 runs in fihooks.class.php. I know how to retrieve stuff from the $scriptProperties array but I don't know how to check contents of placeholders while in PHP.
[ed. note: aaronkent last edited this post 9 years, 3 months ago.]