Closed (fixed)
Project:
Checkout (Content locking)
Version:
6.x-2.2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Jul 2008 at 21:10 UTC
Updated:
25 Aug 2008 at 18:22 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
smk-ka commentedYes, this is a major mismatch, sorry for the trouble...
Can you please test the attached patch? This should fix your issue.
Comment #2
tomaszx commentedhm, still the same. I think that this is related to: #245685: Page being redirected in a way that will never complete
Comment #3
smk-ka commentedSince 2.2 is out, is this now resolved?
Comment #4
tomaszx commentedYes, for me 2.2 works ok.
Thanks Stefan.
Comment #5
smk-ka commentedClosing then.
Comment #6
Anonymous (not verified) commentedHi,
it doesn't work this way when webfm is installed (and maybe other modules using ajax for some edit form stuff). hook_init is called several times during the webfm initialization (I don't understand all of that, but the ajax stuff does some strange things), and
$_GET['q']will be "webfm_js". Therefore, the lock will immediately be removed when webfm is initialized on the web form.You can't see that by debugging messages when editing the page, because drupal_set_messages issued when ajax does cause the hook_init are cashed. They are shown e.g. when you reload the edit form, then you see sth. like this:
So, hook_init might not be the right place for this. I don't have an idea for a patch at the moment.
Comment #7
Frank Steiner commentedHi,
I didn't find a way to change webfm to avoid this problem. webfm adds
in
hook_menuand uses the URLhttp://.../webfm_jsfor interaction between the .js file and the ajax function in the module. So when building the file tree or the list of attached files in the node edit form, the.../webfm_jspage is indeed called several times and every time this executes checkout_init.I didn't find a better way than explicitely checking for the webfm_js url in checkout_init. With this patch, checkout works again with webfm.
Comment #8
smk-ka commentedI see... However, this patch isn't a solution.
I see two possible ways to solve this issue:
However, webfm.js doesn't seem to use jQuery (checked only 5.x branch), so it would require patching, too. Otherwise we should be safe, as long as modules are using jQuery to request data.
What do you think?
Comment #9
Frank Steiner commentedI agree that 1. doesn't sound nice. About 2., I don't know what jQuery is, so I will have to learn about that and see if I can submit a patch to webmf (no idea if they would accept it, though, there is some kind of silence in the maintenance for the 6.x branch :-().
Comment #10
Frank Steiner commentedwebfm is using a XMLHttpRequest object for the POST requests. It's no big deal to add
to webfm.js so that we could use the same check as for jQueries (if I got that right). I tried with the attached patch (and the patched webfm code) and locking works fine now since the webfm queries don't execute the checkout handler anymore.
Would that be an acceptable way? I would submit the patch to webfm if you agree.
Comment #11
smk-ka commentedAgreed, committed with slight modifications.
Comment #12
Frank Steiner commentedThanks! I will submit the patch to webfm.
Comment #13
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.