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

mohammed j. razem’s picture

Hi, 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?

greylogic’s picture

Hi,

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.

  $settings = better_messages_get_settings();
  $messages = theme('status_messages'); 
  $better_messages = theme('better_messages', $messages, $settings['id']);

then i add both $messages and $better_messages to the output. This seems to do the trick.

mohammed j. razem’s picture

Status: Active » Closed (duplicate)
mohammed j. razem’s picture

Version: 6.x-1.3 » 6.x-1.x-dev
Assigned: Unassigned » mohammed j. razem
Status: Closed (duplicate) » Fixed

That 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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.