Hi,
Since yesterday, I've been trying to figure out what has been causing the blank pages on the 'Add New User' and 'Create Table' actions on the demo server [0] (while it works fine on my system). I've narrowed it down to two calls to document.write(), which are a part of the Google Analytics and Piwik code. When jQuery inserts content retrieved over an Ajax call into the DOM, it evaluates the inline javascript. [1]
One possible, partial solution is to do what John Resig has shown in this blogpost [2], to write a more compliant document.write() function. However, he admits that this is only a partial solution and is not cross-browser. I've been trying to hack around, but I've not been successful in resolving this issue. Has anyone come across a better solution?
----------------------------------------------------- [0] - http://demo.phpmyadmin.net/gsoc-ninadsp/ [1] - http://api.jquery.com/jQuery.ajax/ (documentation for the dataType parameter explains how inline JS is handled) [2] - http://ejohn.org/blog/xhtml-documentwrite-and-adsense/ -----------------------------------------------------
Ninad S. Pundalik Twitter: @ni_nad | Identica : @ninad | http://ninadpundalik.co.cc/blog GPG Key Fingerprint: 2DF7 B856 C75E C9F9 0504 C0EF D456 1946 7C45 2C69
Hi
Dne Thu, 1 Jul 2010 23:25:31 +0530 Ninad Pundalik ninadsp16289@gmail.com napsal(a):
Since yesterday, I've been trying to figure out what has been causing the blank pages on the 'Add New User' and 'Create Table' actions on the demo server [0] (while it works fine on my system). I've narrowed it down to two calls to document.write(), which are a part of the Google Analytics and Piwik code. When jQuery inserts content retrieved over an Ajax call into the DOM, it evaluates the inline javascript. [1]
One possible, partial solution is to do what John Resig has shown in this blogpost [2], to write a more compliant document.write() function. However, he admits that this is only a partial solution and is not cross-browser. I've been trying to hack around, but I've not been successful in resolving this issue. Has anyone come across a better solution?
I replaced the Google Analytics and Piwik code with DOM functions, so it should be fixed.
On 2 July 2010 13:50, Michal Čihař michal@cihar.com wrote:
I replaced the Google Analytics and Piwik code with DOM functions, so it should be fixed.
Still causing the same issues on Firefox 3.6.3 and Opera 10.5 on *buntu 10.04. Is anyone else facing the same issues or am I the only one here? I'm trying to replicate the bugs that Marc reported about a newly added user not being visible on paginating the user's table.
On Firefox, when an Ajax request completes and the retrieved response is evaluated/inserted, the content frame goes completely blank and an incomplete request is seen (i.e., the Reload/Stop button is switched to Stop). On Opera, I momentarily see the dialog being displayed, and the content frame goes blank, and the Ad-Bard Network's script loads an advertisement and the page load stops.
Ninad S. Pundalik
Hi Ninad,
2010/7/7 Ninad Pundalik ninadsp16289@gmail.com:
On 2 July 2010 13:50, Michal Čihař michal@cihar.com wrote:
I replaced the Google Analytics and Piwik code with DOM functions, so it should be fixed.
Still causing the same issues on Firefox 3.6.3 and Opera 10.5 on *buntu 10.04. Is anyone else facing the same issues or am I the only one here? I'm trying to replicate the bugs that Marc reported about a newly added user not being visible on paginating the user's table.
On Kubuntu 10.04, FF 3.6.6, I can add a user. After adding I'm redirected to the privileges page and a message 'User was succesfully created' (or something like that) pops up. But the created user is not listed. On top of the query dialog, which shows the correct 'create user' statements, there is a very small message (with the warning icon) but it doesn't seem to contain a message. After refreshing the page (clicking on the privileges tab again, or on the first letter of the username, the user appears in the list). When deleting the user, it is not listed anymore, so that works fine.
After adding the same user a second time (after it was deleted, ofcourse), I got this error message :
Notice in ./libraries/common.lib.php#1065 Undefined index: cell_align_left
Backtrace
./server_privileges.php#1345: PMA_showMessage( NULL, string CREATE USER 'dieter'@'%' IDENTIFIED BY '***';GRANT USAGE ON *.* TO 'dieter'@'%' IDENTIFIED BY '***' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;, )
A few more things : * the 'add user' page doesn't seem to like it when you hit enter to submit your data. I got some kind of 'unable to execute : undefined' error, even if I clicked on the 'Add user' button. * After doing something on the privileges page (adding/removing user), a yellow box with a message appears. After a few seconds, it disappears, but immediately a new yellow box (but empty) appears, leaving a small yellow bar on top of the screen. It dissappears after a few seconds, but I guess it would be better if it wouldn't appear, if there wasn't a message in it.
Comments on adding a table to a database :
* If the input fields to create fields is bigger than can fit on a screen, there are no scrollbars, so some part of the form is not accessible/readable. * after adding a table, it is not visible in the table list of the database. After reloading the page it is listed.
I hope this helps.
Greets,
Dieter
Dieter Adriaenssens a écrit :
Hi Ninad,
2010/7/7 Ninad Pundalik ninadsp16289@gmail.com:
Still causing the same issues on Firefox 3.6.3 and Opera 10.5 on *buntu 10.04. Is anyone else facing the same issues or am I the only one here? I'm trying to replicate the bugs that Marc reported about a newly added user not being visible on paginating the user's table.
On Kubuntu 10.04, FF 3.6.6, I can add a user. After adding I'm redirected to the privileges page and a message 'User was succesfully created' (or something like that) pops up. But the created user is not listed. On top of the query dialog, which shows the correct 'create user' statements, there is a very small message (with the warning icon) but it doesn't seem to contain a message.
This very small message is caused by: <div class="notice"></div>
After refreshing the page (clicking on the privileges tab again, or on the first letter of the username, the user appears in the list). When deleting the user, it is not listed anymore, so that works fine.
For me, testing with FF 3.6.6 on Windows Vista, even after clicking on the first letter, the newly created user does not appear.
A few more things :
- the 'add user' page doesn't seem to like it when you hit enter to
submit your data. I got some kind of 'unable to execute : undefined' error, even if I clicked on the 'Add user' button.
Hitting "enter" does nothing for me. Is this a normal behavior for jQuery dialog?
- After doing something on the privileges page (adding/removing user),
a yellow box with a message appears. After a few seconds, it disappears, but immediately a new yellow box (but empty) appears, leaving a small yellow bar on top of the screen. It dissappears after a few seconds, but I guess it would be better if it wouldn't appear, if there wasn't a message in it.
Same for me, although now this happens only when removing a user.
Comments on adding a table to a database :
- If the input fields to create fields is bigger than can fit on a
screen, there are no scrollbars, so some part of the form is not accessible/readable.
There is an horizontal scrollbar now.
Ninad, please respond to this list when changes are made to your tree in reaction to comments.
- after adding a table, it is not visible in the table list of the
database. After reloading the page it is listed.
I tested again and it seems I cannot even create a table; after clicking on save, the dialog stays there.
Also, when creating a table and asking to add a column, I see "processing request" but the column is not added to the dialog.
Hi,
Replies inline, have edited the messages a little, to put similar issues together. Sorry for messing up the order.
<snip>
On top of the query dialog, which shows the correct 'create user' statements, there is a very small message (with the warning icon) but it doesn't seem to contain a message.
This very small message is caused by:
<div class="notice"></div>
</snip> Fixed. Caused due to a modification made to PMA_showMessage() for Ajax requests.
<snip>
For me, testing with FF 3.6.6 on Windows Vista, even after clicking on the first letter, the newly created user does not appear.
</snip> Tested on FF 3.6.6 and 3.6.3. Newly created user is visible in the list retrieved on clicking the first user. Could we be having caching issues? It works when I take the following steps: - Open Privileges page - Add New User - Click on first letter that contains the user name of the new user.
It seems to fail when the following steps are taken: - Open Privileges page - Paginate the list of users, clicking on the same alphabet that would be the beginning of the new username - Add New User - Again paginate the list of users and show the same alphabet
Will a simple call to Math.random() be sufficient to add an extra GET/POST variable parameter that would not return the cached user's list? I don't remember seeing any function in the js/ folder that would generate a random string that I could use here.
<snip>
On Kubuntu 10.04, FF 3.6.6, I can add a user. After adding I'm redirected to the privileges page and a message 'User was succesfully created' (or something like that) pops up. But the created user is not listed.
</snip>
AND
<snip>
- after adding a table, it is not visible in the table list of the
database. After reloading the page it is listed.
</snip> Both require that I add to the table that already exists. I'm working on it and will be committed to the repository in a few hours.
<snip>
A few more things :
- the 'add user' page doesn't seem to like it when you hit enter to
submit your data. I got some kind of 'unable to execute : undefined' error, even if I clicked on the 'Add user' button.
Hitting "enter" does nothing for me. Is this a normal behavior for jQuery dialog?
</snip> jQuery dialogs will submit that form when we click on one of the buttons. I'm trying to figure out if I can trigger the same event by hooking up the same functions on the form's submit event.
<snip>
- After doing something on the privileges page (adding/removing user),
a yellow box with a message appears. After a few seconds, it disappears, but immediately a new yellow box (but empty) appears, leaving a small yellow bar on top of the screen. It dissappears after a few seconds, but I guess it would be better if it wouldn't appear, if there wasn't a message in it.
Same for me, although now this happens only when removing a user.
</snip> Should be fixed now. I've just pushed the changes, should take a little while to refresh on the demo server.
<snip>
Comments on adding a table to a database :
- If the input fields to create fields is bigger than can fit on a
screen, there are no scrollbars, so some part of the form is not accessible/readable.
There is an horizontal scrollbar now.
</snip> That is one of the issues I was thinking about, but jQueryUI added the scrollbar automatically when I tested it. Hence, I didn't think too much about it. Maybe, if we could highlight the scrollbar in some way, the user might not feel lost.
<snip>
I tested again and it seems I cannot even create a table; after clicking on save, the dialog stays there.
</snip> The dialog stays there till the request completes successfully. The error handling seems to be faulty, or it would have shown an error message in case there was one. I'll fix it.
<snip>
Also, when creating a table and asking to add a column, I see "processing request" but the column is not added to the dialog.
</snip> When the form's content is retrieved with the new number of columns, it is simply inserted in place of the previous form. I guess we should show an alert that the form has been updated. I'll add an Ajax notification at the end of the request.
Ninad Pundalik a écrit :
<snip> > For me, testing with FF 3.6.6 on Windows Vista, even after clicking on > the first letter, the newly created user does not appear. </snip> Tested on FF 3.6.6 and 3.6.3. Newly created user is visible in the list retrieved on clicking the first user. Could we be having caching issues? It works when I take the following steps: - Open Privileges page - Add New User - Click on first letter that contains the user name of the new user.
Testing with commit a1e97024.
For me, the previous scenario does not work; on a server with just 3 users, creating a 4th then to see it, I must click "Show all".
Dieter, does Ninad's scenario work for you?
It seems to fail when the following steps are taken:
- Open Privileges page
- Paginate the list of users, clicking on the same alphabet that would
be the beginning of the new username
- Add New User
- Again paginate the list of users and show the same alphabet
Will a simple call to Math.random() be sufficient to add an extra GET/POST variable parameter that would not return the cached user's list? I don't remember seeing any function in the js/ folder that would generate a random string that I could use here.
I would be happen to try this with your added random value.
I wonder why removing a user would not bring an older page from the cache (you are talking about the browser cache, right?) while creating a user would.
<snip> >> On Kubuntu 10.04, FF 3.6.6, I can add a user. After adding I'm >> redirected to the privileges page and a message 'User was succesfully >> created' (or something like that) pops up. But the created user is not >> listed. </snip>
AND
<snip> >> * after adding a table, it is not visible in the table list of the >> database. After reloading the page it is listed. </snip> Both require that I add to the table that already exists. I'm working on it and will be committed to the repository in a few hours.
<snip> >> A few more things : >> * the 'add user' page doesn't seem to like it when you hit enter to >> submit your data. I got some kind of 'unable to execute : undefined' >> error, even if I clicked on the 'Add user' button. > Hitting "enter" does nothing for me. Is this a normal behavior for > jQuery dialog? </snip> jQuery dialogs will submit that form when we click on one of the buttons. I'm trying to figure out if I can trigger the same event by hooking up the same functions on the form's submit event.
For this to work, I believe that the create button would need to be highlighted to show that it's the action of the Enter key.
I just tried here http://jqueryui.com/demos/dialog/#modal-form and the Enter key does not work; maybe it's not intended to work.
<snip> >> * After doing something on the privileges page (adding/removing user), >> a yellow box with a message appears. After a few seconds, it >> disappears, but immediately a new yellow box (but empty) appears, >> leaving a small yellow bar on top of the screen. It dissappears after >> a few seconds, but I guess it would be better if it wouldn't appear, >> if there wasn't a message in it. > Same for me, although now this happens only when removing a user. </snip> Should be fixed now. I've just pushed the changes, should take a little while to refresh on the demo server.
<snip> >> Comments on adding a table to a database : >> >> * If the input fields to create fields is bigger than can fit on a >> screen, there are no scrollbars, so some part of the form is not >> accessible/readable. > There is an horizontal scrollbar now. </snip> That is one of the issues I was thinking about, but jQueryUI added the scrollbar automatically when I tested it. Hence, I didn't think too much about it. Maybe, if we could highlight the scrollbar in some way, the user might not feel lost.
<snip> > I tested again and it seems I cannot even create a table; after clicking > on save, the dialog stays there. </snip> The dialog stays there till the request completes successfully. The error handling seems to be faulty, or it would have shown an error message in case there was one. I'll fix it.
<snip> > Also, when creating a table and asking to add a column, I see > "processing request" but the column is not added to the dialog. </snip> When the form's content is retrieved with the new number of columns, it is simply inserted in place of the previous form. I guess we should show an alert that the form has been updated. I'll add an Ajax notification at the end of the request.
In your previous release I was not seeing the added column but now it's fixed.
2010/7/12 Marc Delisle marc@infomarc.info:
Ninad Pundalik a écrit :
Will a simple call to Math.random() be sufficient to add an extra GET/POST variable parameter that would not return the cached user's list? I don't remember seeing any function in the js/ folder that would generate a random string that I could use here.
I would be happen to try this with your added random value.
I wonder why removing a user would not bring an older page from the cache (you are talking about the browser cache, right?) while creating a user would.
Always use POST requests, these aren't cached by browsers.
On 13/07/2010, Marc Delisle marc@infomarc.info wrote:
I would be happen to try this with your added random value.
I wonder why removing a user would not bring an older page from the cache (you are talking about the browser cache, right?) while creating a user would.
I just tried out the Math.random() hack in commit 7dd8745. It seems to work, though I've not tested it thoroughly.
The caching issue existed for me even when I deleted a user. Right now, I was coding the part where the new user would be added to the user's table (something that's been on the back burner for a long time), and I had an old user (a1), which was being repeatedly shown in the list of users when I clicked 'Show All', even though I'd deleted that user. Yes, I was thinking about the browser cache.
@Piotr: I didn't know that! Thanks a lot :).
Ninad Pundalik a écrit :
On 13/07/2010, Marc Delisle marc@infomarc.info wrote:
I would be happen to try this with your added random value.
I wonder why removing a user would not bring an older page from the cache (you are talking about the browser cache, right?) while creating a user would.
I just tried out the Math.random() hack in commit 7dd8745. It seems to work, though I've not tested it thoroughly.
With this commit, newly created users are correctly displayed. Good job!
On my other server with about 60 users, clicking on a letter or on "Show all" still does not work (apart from displaying "Loading").
2010/7/12 Marc Delisle marc@infomarc.info:
Ninad Pundalik a écrit :
<snip> > For me, testing with FF 3.6.6 on Windows Vista, even after clicking on > the first letter, the newly created user does not appear. </snip> Tested on FF 3.6.6 and 3.6.3. Newly created user is visible in the list retrieved on clicking the first user. Could we be having caching issues? It works when I take the following steps: - Open Privileges page - Add New User - Click on first letter that contains the user name of the new user.
Testing with commit a1e97024.
For me, the previous scenario does not work; on a server with just 3 users, creating a 4th then to see it, I must click "Show all".
Dieter, does Ninad's scenario work for you?
I tried to test, but I guess something wrong with the demo server, because I couldn't login. (I was able to login, but got the login screen at a certain moment, and couldn't login from that moment on, not even with a different browser)
Greets,
Dieter
Dieter Adriaenssens a écrit :
2010/7/12 Marc Delisle marc@infomarc.info:
Ninad Pundalik a écrit :
<snip> > For me, testing with FF 3.6.6 on Windows Vista, even after clicking on > the first letter, the newly created user does not appear. </snip> Tested on FF 3.6.6 and 3.6.3. Newly created user is visible in the list retrieved on clicking the first user. Could we be having caching issues? It works when I take the following steps: - Open Privileges page - Add New User - Click on first letter that contains the user name of the new user.
Testing with commit a1e97024.
For me, the previous scenario does not work; on a server with just 3 users, creating a 4th then to see it, I must click "Show all".
Dieter, does Ninad's scenario work for you?
I tried to test, but I guess something wrong with the demo server, because I couldn't login. (I was able to login, but got the login screen at a certain moment, and couldn't login from that moment on, not even with a different browser)
Greets,
Dieter
You mean this URL? http://demo.phpmyadmin.net/gsoc-ninadsp/
I can log in, do simple tasks but when I want to create a user, nothing happens.
On 13/07/2010, Marc Delisle marc@infomarc.info wrote:
I tried to test, but I guess something wrong with the demo server, because I couldn't login. (I was able to login, but got the login screen at a certain moment, and couldn't login from that moment on, not even with a different browser)
Greets,
Dieter
You mean this URL? http://demo.phpmyadmin.net/gsoc-ninadsp/
I can log in, do simple tasks but when I want to create a user, nothing happens.
I'll use Firebug and see if there are any errors.
2010/7/13 Ninad Pundalik ninadsp16289@gmail.com:
On 13/07/2010, Marc Delisle marc@infomarc.info wrote:
I tried to test, but I guess something wrong with the demo server, because I couldn't login. (I was able to login, but got the login screen at a certain moment, and couldn't login from that moment on, not even with a different browser)
Greets,
Dieter
You mean this URL? http://demo.phpmyadmin.net/gsoc-ninadsp/
I can log in, do simple tasks but when I want to create a user, nothing happens.
I'll use Firebug and see if there are any errors.
I was able to login now. Maybe there was a temporary glitch.
I created a user, and it was listed. But if appears at the end of the userlist (not sorted alphabeticaly), but this is solved when clicking on the Show All or a first letter link.
Also the link of the first letter wasn't updated. I mean, after adding a user with a first letter that wasn't in the list before, the first letter doesn't become a link. This worked when I tested this earlier. The list of first letter links is only updated after a reload of the priviliges page. (The first letter issue applies also to removing a user)
BTW : I tested with Kubuntu 10.4, FF 3.6.6, git rev 7dd8745 on demoserver http://demo.phpmyadmin.net/gsoc-ninadsp/
Kind regards,
Dieter
Hi Dieter,
On 13/07/2010, Dieter Adriaenssens dieter.adriaenssens@gmail.com wrote:
I created a user, and it was listed. But if appears at the end of the userlist (not sorted alphabeticaly), but this is solved when clicking on the Show All or a first letter link.
Clicking on the 'Show All' works because the entire table of users is reloaded from the server. I'm still trying to figure out if I can add the user at the correct location in the list.
Also the link of the first letter wasn't updated. I mean, after adding a user with a first letter that wasn't in the list before, the first letter doesn't become a link. This worked when I tested this earlier. The list of first letter links is only updated after a reload of the priviliges page. (The first letter issue applies also to removing a user)
Did this! Thanks for the idea. Was easier than I expected it to be. I pushed it in commit 7033154. You should be able to test it out on the demo server within the hour. :)
Hi Ninad,
2010/7/16 Ninad Pundalik ninadsp16289@gmail.com:
Hi Dieter,
On 13/07/2010, Dieter Adriaenssens dieter.adriaenssens@gmail.com wrote:
I created a user, and it was listed. But if appears at the end of the userlist (not sorted alphabeticaly), but this is solved when clicking on the Show All or a first letter link.
Clicking on the 'Show All' works because the entire table of users is reloaded from the server. I'm still trying to figure out if I can add the user at the correct location in the list.
I don't know what format you get the data in, but maybe you can do a sort? (I don't know JS, so don't blame me for my ignorance ;) )
Also the link of the first letter wasn't updated. I mean, after adding a user with a first letter that wasn't in the list before, the first letter doesn't become a link. This worked when I tested this earlier. The list of first letter links is only updated after a reload of the priviliges page. (The first letter issue applies also to removing a user)
Did this! Thanks for the idea. Was easier than I expected it to be. I pushed it in commit 7033154. You should be able to test it out on the demo server within the hour. :)
I tested it on the demoserver (with FF 3.6.7 on Kubuntu 10.4.1) and it works.
Greets,
Dieter
Hi Dieter,
On 24/07/2010, Dieter Adriaenssens dieter.adriaenssens@gmail.com wrote:
I don't know what format you get the data in, but maybe you can do a sort? (I don't know JS, so don't blame me for my ignorance ;) )
It is possible, and it turned out to be a lot easier than I thought. All credit goes to Nettuts+ though. They have a nice tutorial to sort a table with jQuery. I have it working now, and I'll see if I can fit it in better with the code that inserts the row to the table and push the changes in a couple of hours.
I tested it on the demoserver (with FF 3.6.7 on Kubuntu 10.4.1) and it works.
It would, as I'm using the same testbench. :)
Hi Ninad,
2010/7/24 Ninad Pundalik ninadsp16289@gmail.com:
Hi Dieter,
On 24/07/2010, Dieter Adriaenssens dieter.adriaenssens@gmail.com wrote:
I don't know what format you get the data in, but maybe you can do a sort? (I don't know JS, so don't blame me for my ignorance ;) )
It is possible, and it turned out to be a lot easier than I thought. All credit goes to Nettuts+ though. They have a nice tutorial to sort a table with jQuery. I have it working now, and I'll see if I can fit it in better with the code that inserts the row to the table and push the changes in a couple of hours.
It seems to work. The user I added was inserted at the right spot in the list, after the insert. :)
I tested it on the demoserver (with FF 3.6.7 on Kubuntu 10.4.1) and it works.
It would, as I'm using the same testbench. :)
OK, I tried it with Google Chrome 5.0.375.99 (on Kubuntu 10.4.1), but I get a white screen (only the add shows) when clicking on the 'Add new user' link. The same behaviour when adding a new table.
I tested with some other browsers :
* IE8 on Win2003 Server : Adding a new user works and it's listed at the right spot, but the new first letter is not there. There is a gap where the letter should be. After reloading the page, the first letter link is there. When deleting the user, the not-link first letter is there, so that works.
* IE6 on Win2003 Server : same behaviour as with IE8.
* FF 3.5.7 on Win2003 Server : everything works fine.
Greets,
Dieter
On 13/07/2010, Marc Delisle marc@infomarc.info wrote:
<snip> >> A few more things : >> * the 'add user' page doesn't seem to like it when you hit enter to >> submit your data. I got some kind of 'unable to execute : undefined' >> error, even if I clicked on the 'Add user' button. > Hitting "enter" does nothing for me. Is this a normal behavior for > jQuery dialog? </snip> jQuery dialogs will submit that form when we click on one of the buttons. I'm trying to figure out if I can trigger the same event by hooking up the same functions on the form's submit event.
For this to work, I believe that the create button would need to be highlighted to show that it's the action of the Enter key.
I just tried here http://jqueryui.com/demos/dialog/#modal-form and the Enter key does not work; maybe it's not intended to work.
A possible work around to this would be to not use the jQueryUI dialog buttons to post the form. Instead, we can attach the ajax post to the submit event for the form, and just keep a cancel button, the way it is on the new table form. I realised this yesterday when I was testing the appending of the new table to the list of tables.