Closed (fixed)
Project:
Flag
Version:
8.x-4.x-dev
Component:
Views integration
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
23 Jan 2017 at 22:16 UTC
Updated:
18 Mar 2018 at 20:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
kpv commentedComment #3
joachim commentedComment #4
tbrix commentedI am not sure if this is right, but returning $link_type_plugin->getAsFlagLink($flag, $entity) if the plugintype is ajax_link as in this patch works.
Comment #5
joachim commentedThanks for having a go at this.
It doesn't look quite right to me though:
Why do we need to special case a particular link type plugin?
Comment #6
tbrix commentedSorry you are right. It does not look right. I am not clear on why getAsLink is used here and not getAsFlagLink. Rendering via getAsFlagLink also seems to work for the special case added in dev for the FormEntryInterface plugin. Would it be correct to drop the special cases and use getAsFlagLink for all cases here ?
Comment #7
sagesolutions commentedApplied patch #4 and it worked for me.
Thanks!
Comment #8
imiksuTried the patch and it seems to fix the issue.
Comment #9
socketwench commentedI thought so too, but it seemed to blow up the entire module. Not sure why, though.
Comment #10
joachim commentedBlow up in what way....?
Comment #11
socketwench commentedHmmm, I can't really remember! I was having one of those tired, frustrated with my utter lack of time for everything kind of days.
So, let's try this patch and see what happens.
Comment #13
joachim commentedThanks!
A lot of those failures look like they're from the 'extra_permissions' system that was committed recently. So it looks like this patch needs a reroll to account for that.
Comment #14
martin107 commentedI am sorry, I dont have time at the moment to investigate further .... this comment may or may not be helpful!
are test broken for 8.x-4.x-dev at the moment?
these 61 failing tests are suspiciously similar to failures in separate issue.
#2764709: [Regression/Refactor] Restore Ajax link type "flag message" functionality
as it went from 37 to 36 I only added an extra test and yet similar 'extra_permissions' failure appeared.
Sorry if this is me crying wolf.
Comment #15
joachim commentedhttps://www.drupal.org/node/268362/qa says they pass, but the results are a couple of weeks old. Should be from our most recent commit, but I've queued a test to be sure.
Comment #16
socketwench commentedRetesting now that the branch failures are resolved.
Comment #17
socketwench commentedHuh. So that works according to the tests. Does this solve the original issue? is there any way we can simplify this code further?
Comment #18
socketwench commentedThe #11 patch does fix the view issue, but we really need test coverage for it. We could leverage the Flag Bookmark test if we were to make the flag an AJAX link instead. Not sure what else that would break, yet, though.
Comment #19
joachim commentedMy comment #5 still stands.
Comment #20
rasikap commentedThe patch in #11 works for me.
Comment #21
madhukunj commentedI have tested on my Views before Using #11 patch on click on flag link ajax is not working as expected but after applying this patch AJAX link is working fine for me
Comment #22
joachim commentedThere is no point in people commenting to say the patch works -- further work is needed on it as stated in #5.
Comment #23
oleksiyUpdated patch where the flag.link_builder service uses for link generation. Not sure that it's the correct way to solve the issue. Please review.
Comment #24
socketwench commentedThis seems like much more the correct approach, it parallels the approach in `flag_entity_view()`, although the render array looks different:
We're calling the same method though, so it might be right. We still need tests for this, but I think we're on the right track.
For the tests, I'm wondering if we should just modify one of the views in either flag_follower or flag_bookmark and make that an AJAX link.
Comment #25
andypost+1 to use lazy builder
Comment #26
Manoj Raj.R commented#4 Worked for me
Comment #27
kerasai commentedConfirming that the patch in #23 works as expected--the link in the view renders as AJAX-enabled and successfully performs the AJAX operation.
Comment #28
oleksiyI can't reproduce the issue on clear Drupal 8 (8.6.x) + Flag module (8.x-4.x) installation. It's also OK with AJAX for a view option enabled.
Maybe someone can share a view config export where this issue can be reproduced.
Comment #29
andypost@Oleksiy If there is no bug then this issue is a Task to use lazy builder for views
@socketwench It makes sense to "normalize" how flag links are build, and common service is good way ahead
Comment #30
socketwench commentedThe lazy builder still works, and the work in #2764709: [Regression/Refactor] Restore Ajax link type "flag message" functionality actually covers the need for tests, so let's get this in.
Comment #32
socketwench commentedThanks everyone!