Pressing Close link leads to blank page
yngens - August 21, 2007 - 10:13
| Project: | Admin message |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Pressing Close link leads to blank page (admin_message/close/6437) and it just does not return.

#1
Do you have javascript turned on?
#2
sure, i do
#3
probably it conflicts with some other module. but i have long list of modules. i will try to identify by switching them off one by one.
#4
Did you find out what was causing it?
#5
I could not find. And that's why I decided not to use this module for now.
Why at all it needs to go admin_message/close/nid? Can it be closed somehow (using javascript) at the same page without redirecting?
#6
That's the thing, it IS closed with JavaScript, that's why I asked you if you had it turned on. I would try it with a different browser, look for JavaScript errors, turn off other modules and a last try to install it on a newly installed drupal 5.2.
#7
I closed all the modules and tried admin message module. Alas, it still redirects to a blank page.
#8
Browser, browser version, operation system? Did you try a different browser? Any js errors logged (they are displayed differently depending on the browser you use)? I need more than just, "it isn't working" - It's working here. Demopage?
#9
I tested with new install and it works. I do not know why it does not work on my site. Probably it gets into conflict with one of custom modifications. Tested in Firefox/2.0.0.6 and IE 7.0.57.x.x. Unix. I will try to figure out and if I find something I will post it here.
There is no demopage, this is happening on a production site. I can send you a link if you want to take a look.
#10
Well, if it's works on a new installation with the same browser that's enough for me, so marking as fixed. Of course, if you find out what the initial problem was, and especially if it can be dealt with in this module, post it here.
#11
#12
I had the same problem.
I noticed that my admin block didn't have the id '#block-admin_message-admin_message'. So the line $("#block-admin_message-admin_message a.close") didn't find any elements.
The solution for me, was to tell jQuery to look for a different block id.
Perhapse a better solution would be to look for something like $('a.admin-message-close') instead?
Another thing:
Shouldn't the close page redirect users without JavaScript back to the page from where they came, instead of just showing a blank page?
#13
what ID did that block have? (I didn't know they could be different).
And yes, non-js useres should be redirected to another page or have the page refreshed, but that's a seperate issue. I've been to lazy to fix that (patches welcomed :) )
#14
I have the same issue on Drupal 5.7. in addition to that anonymous users get a 403.
#15
Sorry, I need more info here. Why does the js fail? Any errors? What HTML ID does the block have?
And this module *does not* work for anonymous users, and is not meant to do.
#16
I am very sorry. First I did not read the introduction on the project page correctly. Because it states that it is not supposed to work for anonymous users. Secondly, I am actually glad it doesn't work for them, that way each anonymous gets to see the message!!
Now on my problem, it seems that the js fails. 2 things happen here
I do not know why the js fails, if you could help me telling me where to look far the answer I can definitely tell you that. Same goes for the HTML ID, where do I find it?
#17
#12 says "The solution for me, was to tell jQuery to look for a different block id." how exactly i can do the same? the problem still persists on another site with another theme.
#18
any update on resolving this issue?
#19
@fajerstarter: I've changed the id's of my blocks simply by using a block template. I did this because I wanted more meaningful block id's.
So instead of: #block-block-1
I might have: #block-latest-news
The problem is that the module is looking for a specific block id:
$("#block-admin_message-admin_message a.close").click(function() { (from admin_message.js)
But my block isn't named #block-admin_message-admin_message, it's name something else.
My suggestion is to give the close link a unique id so we can do something like:
$("a#admin_message-close").click(function() {
#20
I have 'block-admin_message-admin_message' for the modules block id, but the messages don't close anyway. Please someone offer a patch. Suggestion do not help for non-coders.
This module offers such a good feature, but it is a big pity it does not work properly.
#21
Ok, probably someone wıll be interested to solve this for modest 30 USD chip in?
#22
I am raising my bounty to 50 USD.
#23
@thulstrup: I agree that the name of the block ID is far from beautiful. But on the other hand I think that scripts should be able to use the ID of an elements. Traversing the DOM by ID is the fastest way of getting an element. You should be able to exclude the block ID from being renamed or even override the JavaScrip-file with a custom one.
@yngens: If the ID is not the problem I'm not sure what's causing it. Do you have an example site?
#24
fajerstarter, yes please register on http://blog.kyrgyz.us i will post a new admin message for new users there.
#25
The script is not even added to the page...
Look for
<script type="text/javascript" src="/drupal-5-0/sites/localhost/modules/admin_message/admin_message.js"></script>in the header. it should be there when the block is rendered. As mentioned earlier I would start with disabling modules and the custom theme.#26
fajerstarte, this is fresh install of drupal: http://getnick.com with only core-required modules. close link anyway leads to empty page :(
#27
I also see now that the css-file isn't added as well, so something fishy is going on. Those files (JS and CSS) are added at row 118 in admin_message.module, so start debugging there.
#28
i will try to look into it, but unfortunately i am not a coder and i doubt i will dig something out. have you tried your module on a fresh install?
#29
Sure I have. I'm marking this as won't fix since I can't reproduce this. Feel free re-open if you find something.
#30
I have the same thing... blank screen of death :(My bad, everything works OK :)
#31