When submitting a form such as node/add/story (or any other form where you would normally get a message after submisison) no message confirmation is displayed. I can't work out whether this is by design or a bug, as I've watched a video that shows the confirmations appearing but wonder if that might be an earlier version of the module. Video is here: http://citris-uc.org/files/bdug/popups_api_demo_dec_2008.swf

Comments

lordg’s picture

I have the same issue and can't understand why! Can anyone assist us?

UPDATE: I am running Open Atrium if that helps. I also left the popup on default settings, with "Automatically close final confirmation messages." unchecked. The class attribute I am using is "popups".

Thanks,
G

lordg’s picture

I managed to track this down to be related to the theme. I changed the following code:

function popups_render_as_json($content) {
  // Call theme_page so modules like jquery_update can do their thing. We don't
  // really care about the mark up though.
  $ignore = theme('page', $content);

  $path = $_GET['q']; // Get current path from params.
  return drupal_json(array(
    'title' => drupal_get_title(),
    'messages' => theme('status_messages');,
    'path' => $path,
    'content' => $content,
    'js' => popups_get_js(),
    'css' => popups_get_css(),
  ));
}

to

function popups_render_as_json($content) {
	$messages = theme('status_messages');
  // Call theme_page so modules like jquery_update can do their thing. We don't
  // really care about the mark up though.
  $ignore = theme('page', $content);

  $path = $_GET['q']; // Get current path from params.
  return drupal_json(array(
    'title' => drupal_get_title(),
    'messages' => $messages,
    'path' => $path,
    'content' => $content,
    'js' => popups_get_js(),
    'css' => popups_get_css(),
  ));
}

However, popups doesn't seem effective on managing where the messages should go. Technically it should have a jQuery selector that it can then insert the messages into on load. Same as the content loader.

lordg’s picture

I know one shouldn't modify the code but I had no alternative. Probably this should be made into a patch, but I don't know how to do that yet. :(

lordg’s picture

I also modified the js file to control where the messages go.

Was:

        // Insert the message into the parent layer, above the content.
        // Might not be the standard spot, but it is the easiest to find.
        var $next;
        if (popup.targetLayerSelector() === 'body') {
          $next = $('body').find(Popups.originalSettings.popups.defaultTargetSelector);
        }
        else {
          $next = $(popup.targetLayerSelector()).find('.popups-body');
        }
        $next.parent().find('div.messages').remove(); // Remove the existing messages.
        $next.before(data.messages); // Insert new messages.

Now

        // Insert the message into the parent layer, above the content.
        // Might not be the standard spot, but it is the easiest to find.
        var $next;
        if (popup.targetLayerSelector() === 'body') {
          $next = $('body').find(Popups.originalSettings.popups.defaultTargetSelector);
        }
        else {
          $next = $(popup.targetLayerSelector()).find('.popups-body');
        }
        //$next.parent().find('div.messages').remove(); // Remove the existing messages.
        //$next.before(data.messages); // Insert new messages.
        $('#messages').html(data.messages);

I obviously made sure that my theme had the #messages tag all the time.

colemanw’s picture

Same issue here. It would be great to get a patch for this.
Perhaps also add an option in the admin page of this module to input the jquery selector for site messages?

makt’s picture

Are there any updates for this issue? I am having the same problem. When I was testing this on my local server everything was working but now that the site is live the confirmation messages are not displaying. I even tried changing the module and js files as described above, but no luck.

Does anyone have an updated solution?

colemanw’s picture

Version: 6.x-2.0-alpha6 » 6.x-2.0-beta0
Priority: Normal » Major
Status: Active » Needs review
StatusFileSize
new1.08 KB

Here is a patch against 2.0-beta0 which fixes the problem for my site.

timhsieh’s picture

StatusFileSize
new839 bytes

#2 did fix the issue for me (the message from form_set_error in a validate handler was not being displayed.)

The patch in #7 did not apply for me, but I applied the change manually and rolled this one.

drewish’s picture

Humm... we should put a comment explaining why we're calling theme('status_messages') early on.

drewish’s picture

drewish’s picture

StatusFileSize
new806 bytes
sin’s picture

The patch works. Thanks!

acrollet’s picture

Status: Needs review » Reviewed & tested by the community

works for me, thanks!

lasconic’s picture

Works here too. Thank you.

astutonet’s picture

Status: Reviewed & tested by the community » Active

The patch in #11 doesn't work for me. If I have a webform, for example, when the user submits the data, the loading image is in a loop eternal and don't have confirmation message displayed.

The form, however, is sent.

Someone can help us?

Thanks.

Jenechka’s picture

Works for me too.