Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If you use an ajax page from views like seen in the screenshot and you click on page 1 2 3 4 an extra icon-element is added(screenshot
SCREENSHOT: http://screensnapr.com/v/PdSrsE.png
Comment | File | Size | Author |
---|---|---|---|
#9 | 1178226-drupal-standards-behavior-2.patch | 982 bytes | jefkin |
#9 | 1178226-drupal-standards-behavior-full.patch | 24.38 KB | jefkin |
#7 | 1178226-drupal-standards-behavior.patch | 24.32 KB | jefkin |
#6 | 1178226-drupal-standards-behavior.patch | 24.39 KB | jefkin |
#1 | state_patch.patch | 625 bytes | marcoka |
Comments
Comment #1
marcoka CreditAttribution: marcoka commentedattached patch should solve that
Comment #2
marcoka CreditAttribution: marcoka commentedComment #3
ahwebd CreditAttribution: ahwebd commentedThanks e-anima
Patch working for me
Comment #4
jefkin CreditAttribution: jefkin commentedI discovered this problem in parallel by having an ajax loading bit on a page with a dhtml menu. in addition to the multiple passes causing bouncy menus, the menus I had the cloned menu item apearing 2, 3, 5 times depending on how many ajax calls happened. D:
So I searched here and found this issue, but I have a serious doubt about this patch. I mean, doesn't this patch avoid using the the drupal 7 behaviors update?
instead of:
why not use:
and then change your calls like:
with the recommended style:
Though, I typically don't use in line functions, and instead define new functions (even if relatively simple), as in:
So then your attach code is cleaner looking (instead of the above...):
Either with or without defined functions, just using context and .once() in addition to being part of the best practices, will also make sure that you won't re-run your js over the same section ever -- no matter how many ajax calls you load., and you offer the possibility of having ajax added dhtml menus. Although it's perhaps too complicated a system for *that* to work out of the box.
Comment #5
michaelfavia CreditAttribution: michaelfavia commented@jefkin agree with this method as well. any chance we could squeeze a patch out of you to make it happen? Id be happy to commit it post haste after a review.
Comment #6
jefkin CreditAttribution: jefkin commented@michaelfavia, well quick patch squeezed out. I've tested in all the ways that I use it, (clone). But we should have people checking that use other ways.
Comment #7
jefkin CreditAttribution: jefkin commentedwithout the debugging drivel I left in the top on #6 :-/
Comment #8
michaelfavia CreditAttribution: michaelfavia commentedQuite a patch there ;) I'll do my best to review it tonight or tomorrow and depending on that get it added to the dev branch with proper attribution to you. Thank you!
Comment #9
jefkin CreditAttribution: jefkin commented@michaelfavia
I forgot a last minute change I added two weeks ago.
Uhh :-/ , after a bit of testing my team found a few minor flaws, and one semi-serious one in the patch I last sent.
I'm attaching the specific spot changes based on the #7 patch: "1178226-drupal-standards-behavior-2.patch" to fix it, as well as a full patch from head: "1178226-drupal-standards-behavior-full.patch".
I'm happy to let you know that this newest version is being used in a production site now for 2 weeks without a problem :D
Comment #10
dmegatool CreditAttribution: dmegatool commentedThx for the path ! Works here too :)
Comment #11
jonloh CreditAttribution: jonloh commentedthe latest patch in #9 solves the problem. Just that the patch doesn't work quite well due to some issue in the file itself. Hence, you will need to patch it manually.
Apart from that, it works great ;) Thanks!
Comment #12
Dentorat CreditAttribution: Dentorat commentedAs mentioned, it has to be patched manually, but I'm getting pretty confused trying to do this, can anyone provide a copy of the fully patched file?
Thanks
Comment #13
anneeasterling CreditAttribution: anneeasterling as a volunteer commentedReporting successfully applying this patch to 7.x-1.0-beta1. Extra cloned items no longer appear after a views ajax filter action.
Would it be possible to get this merged to the next release version?
Many thanks!
Comment #14
vuilPlease the patch needs re-roll... I set the issue to Needs work.
Comment #15
vuilAdd Needs reroll in Issue tags.
Comment #16
vuilI also unassigned the issue of @michaelfavia.