Closed (fixed)
Project:
Better Messages
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
22 Jul 2009 at 16:10 UTC
Updated:
9 Aug 2009 at 11:30 UTC
Hi,
I have installed your module and it amazingly improves site usability.
Currently my dev site, i have a lot of form rebuilding happening by AHAH. Is there anyway to use better messages to display the messages send back in the AHAH call?
Thanks for all the greak work with this module.
Comments
Comment #1
mohammed j. razemHi, thanks for you kind words..
I'll have a thorough look at this interesting issue! By the way, did you use any contributed modules like ahah_script_ensurer.module or ahah_style_ensurer.module?
Are your forms using #ahah? If so are you using
$output = theme('status_messages') . $myoutput;to send the JSON output?Comment #2
greylogic commentedHi,
Thanks for a very quick response. yes i use #ahah and theme('status_messages') and JSON. I don't use script and style ensurer modules (trying to keep the module count to minimum). However, i made sure the required js and css files are loaded. I guess, better_messages_init() adds them to all pages.
I did a little bit of debugging and found why the message were not shown. In a AHAH request, the js files are active, however better_messages_preprocess_page() never gets called. so the content that will be generated by theme('better_messages', ...) never gets added to the response.
The js just hides the default messages and doesn't display anything. so I just added the following to my js handling code.
then i add both $messages and $better_messages to the output. This seems to do the trick.
Comment #3
mohammed j. razemComment #4
mohammed j. razemThat actually wasn't a duplicate. Ajax module doesn't use
theme('status_messages')to send validation messages back.So now sending messages back by AHAH is fixed. But not for Ajax module.