Closed (fixed)
Project:
Privatemsg
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Jan 2011 at 12:24 UTC
Updated:
17 Aug 2014 at 12:20 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
berdirThis is nasty, nice catch.
This however sounds like a core issue to me and we can probably not solve it in a clean way.
Maybe if sorting could be done through AJAX as well, but I have no clue if that is possible.
Comment #2
derjochenmeyer commentedHow does the AJAX functionality get added for the actions and the delete button? Is this not something privatemsg is doing?
Comment #3
berdirThe request is sent with AJAX, the action is done and the whole table is rebuild and then replaced. But the problem is that when the table is rebuilt, the current URL ($_GET['q']) is system/ajax. And all links which point to the current page, especially those created by theme_table(), which does create the sorting links.
So we are really just glueing the different parts together which cause this error.
I need to talk to some of of the AJAX people what to do here.
Comment #4
derjochenmeyer commentedIts not even limited to the sorting. If you perform an action "Mark as read"/"Mark as unread"/"Delete" and use the "The previous action can be undone." link the "undo" works, but the destination is set to "system/ajax".
For reference the sorting URL is set in the core function tablesort_header (includes/tablesort.inc, line 169) the undo link ist build in function privatemsg_operation_execute (privatemsg.module, line 2118).
Comment #5
berdirYes, it affects everything that is built durin the AJAX request, although I thought we had a workaround for the undo link.
Comment #6
berdirLooks like can fix it with a simple hack...
(18:39:31) merlinofchaos: You'll probalby need to set $_GET['q'] to the 'right' path.
Will work on a patch soon.
Comment #7
berdirPlease try the attached patch.
Comment #8
berdirWrong status and forgot file.
Comment #9
derjochenmeyer commentedThanks for the patch. The patch fixes the originally reported bug => fixes sorting.
But it does NOT fix the undo-link-bug reported in #4
Comment #10
berdirI can not reproduce the undo bug, this has already been fixed a while ago with a very similiar hack. Are you sure that you are using the most recent version of Privatemsg-7.x-1.x (aka, newer than 7.x-1.0) ?
Comment #11
derjochenmeyer commented/messages/messages/undo/action?destination=system/ajaxwhich points (obviously) to a blank page.Comment #12
BenK commentedFor me, the patch also fixes the originally reported sorting bug.
As for the undo-link-bug, I don't have that problem at all. Undo links work for me both with and without the patch. The link is being sent to the proper place.
I did notice one other small issue, however: After you use the "Mark as read/unread" action, the "check all" checkbox is missing on the subsequent screen.
--Ben
Comment #13
berdirSelect all checkbox is a core bug, see #1031148: Select-all checkbox is not added when updating a table with #ajax
Comment #14
berdirSetting back to needs review since we can't reproduce the undo but and the patch fixes the reported sorting issue.
We can still try to figure out why it doesn't work for @derjochenmeyer after this patch has been commited.
Comment #15
berdirCommited the patch, thanks for reporting and testing.
Setting this back to postponed ( maintainer needs more info) as neither I nor BenK were able to reproduce your issue.
I'm not sure how reliable the drush --dev switch, can you try to specific explicitly privatemsg-7.x-1.x-dev? Or do a CVS checkout...
Comment #16
berdirClosing this issue as there has been no response in multiple weeks.
Comment #18
nguyentran commentedHello,
I have the same problem when I add ajax paging for my inline form edit by ajax, and the patch work for me, Thank you so much. Especial thank to Berdir with your explaination.
Comment #19
geoandri commentedI have the same problem but i am a newbie in drupal.
Can you help me apply the patch?
Where do i have to execute the patch commands?
thank you
Comment #22
berdir