Low variables not parsing on error response/system message pages
When I use low variables in place of snippets that appear on error response pages (for example on a form page with inline error handling turned on), if an error occurs, the low variables don't parse at all.
Is this expected due to parse order? I've tried setting parse order to early and not, but it doesn't seem to make any difference.
I was running into this on system messages as well, my only solution was to revert back to embeds or snippets.
Replies
Low 6 Mar 2012 21:36
I think this has to do with the session_end hook not being called on those pages, so the vars cannot be added to the Snippets array. I will try and confirm with EllisLab...
carlosperez 14 Mar 2012 12:24
Thanks - hopefully it's something that can be addressed!
carlosperez 2 Apr 2012 13:44
Just wondering if you've had any luck with this?
Low 2 Apr 2012 13:49
I don't think there's much I can do about the sessions_end hook not being called in some cases.
What I have done, is move the adding of the early parsed vars to a different hook, which is available in EE 2.4.0+. This should help with your issue, but I need to do a bit more testing. You can always try the latest version and see if that helps your issue.
Low 2 Apr 2012 13:57
By the way, I presume you don't mean the stand-alone User Messages, where only the variables {title} {meta_refresh} {heading} {content} {link} are available, right?
carlosperez 2 Apr 2012 14:02
Actually - I think that is where it is happening. I'm using Custom System Messages for those templates, but didn't know LV wouldn't parse at all though.
Low 2 Apr 2012 14:05
If you're using CSM, then the new hook might get triggered. I'll check if that's the case.
It does work for comment preview pages. The same thing happens there -- the sessions_end hook is not called, thus not adding the variables to the native Snippets array. Calling the new template_fetch_template hook available in EE 2.4.0+ solves it in that case.
carlosperez 2 Apr 2012 14:10
Sorry, I had forgotten a bit about the problem, so I had to go check it out to refresh my memory. The low variable itself gets parsed, however, the contents of the variable do not. For example, I have a an if statement in the low variable being called and the "{if blah == blah}" tags actually show up in the browser.
Low 2 Apr 2012 14:14
What version of EE and LV are you using now? If you could, try and update both to the latest version.
I just did a test using CSM (submitting an empty comment form, triggering the error) and the early parsed vars seem to be working there.
carlosperez 2 Apr 2012 14:15
Using both ee2.3 and ee2.4 with lv 2.1 (two different environments)
Low 2 Apr 2012 14:17
Okay, so, the issue should be fixed for anything EE 2.4+ and LV 2.1+. For anything older, the software should be updated.
Can you confirm if the issue persists?
carlosperez 2 Apr 2012 14:21
EE2.4 + LV2.1.1 seems to be working. Sorry about that. Thanks!
Low 2 Apr 2012 14:22
Great news! :)