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.
At these points flag_get_flag('follow') is a value and not an object. It occurs in fbss_flag.views_default.inc on lines 22 and 291
Comment | File | Size | Author |
---|---|---|---|
#21 | issue_flag.JPG | 109.43 KB | Gaurav.Singh |
#11 | flag-integration-issues-1296238-11.patch | 1.54 KB | mathankumarc |
#9 | fbss-comments-flag-inegration-1296238-9.patch | 2.27 KB | mathankumarc |
#8 | fbss-comments-flag-inegration-1296238-8.patch | 2.25 KB | mathankumarc |
#6 | statuses-flag-integration-1296238-6.patch | 2.55 KB | mathankumarc |
Comments
Comment #1
IceCreamYou CreditAttribution: IceCreamYou commentedYeah, the Flags submodule needs a lot of work. It hasn't really been updated to the Flag 7.x-2.x API yet. Partially because the Flag 7.x-2.x API is not documented at all.
Comment #2
udvranto CreditAttribution: udvranto commentedSubscribing...
Comment #3
udvranto CreditAttribution: udvranto commentedThe only part I have done is pasted below. Hope others contribute for the rest of the update.
Comment #4
IceCreamYou CreditAttribution: IceCreamYou commentedMarked #1427788: Trying to get property of non-object in fbss_flag_views_default_views() (line 22 as duplicate
Comment #5
eidoscomThis must be substitute of the original code????
function on code is: "fbss_flag_views_default_views"
function that you provided is: "fbss_flag_flag_default_flags"
Thanks!!!
Comment #6
mathankumarc CreditAttribution: mathankumarc commentedHere's the patch for it, modified the flag definitions according to flag api 2.
Comment #7
IceCreamYou CreditAttribution: IceCreamYou commentedCommitted the patch in #6 to dev. I haven't tested it but it can't be worse than what's already there (which doesn't work at all).
However, this issue still isn't fixed. There are potential problems everywhere that flag_get_flag() or flag_get_flags() is called:
Comment #8
mathankumarc CreditAttribution: mathankumarc commentedHere is the patch for fbss_comments flag integration.
I think the major problem here is flag integration with views, other areas seems to be fine.
Comment #9
mathankumarc CreditAttribution: mathankumarc commentedOops! previous patch has lot of white spaces.
Here is the clean patch.
Comment #10
IceCreamYou CreditAttribution: IceCreamYou commentedCommitted #9 to dev, thanks!
Leaving at "needs work" because the problem mentioned in #7 still exists.
Comment #11
mathankumarc CreditAttribution: mathankumarc commentedI don't see any issues with flag integration, after changing the flag definitions as per flag api 2(i.e after applying the patch in #2 and #9).
I didn't looked into services integration, since its not ported. I'm sure that flag_get_flag() and flag_get_flags() functions are working fine. However its needs some very little cleanup, added a patch for it.
I think flag integration is stable now. Isaac please share your thoughts on this.
Comment #12
IceCreamYou CreditAttribution: IceCreamYou commented2 of the locations noted in #7 are still a problem:
I am not exactly sure what happened to $flag->status so I'm not 100% sure what to do about this. Probably it is just not possible to disable a flag any more so flags are either enabled or nonexistent, in which case it should be enough to just check whether the flag object exists.
Why did you make this change? We should only be adding fbss_comment flags to status comments, so it looks like that if() statement is required. The only change that probably should be made there is the string concatenation style (there should be a space before and after the concatenation operator . ).
Comment #13
mathankumarc CreditAttribution: mathankumarc commentedflag_get_flags() will return the all the flags(i.e it will return all the content type's flags), however flag_get_flags('fbss_comment') will return the flags which are associated to fbss_comments content type only. So there no need of condition here.
Will look into the $flag->status.
Comment #14
IceCreamYou CreditAttribution: IceCreamYou commentedAh, I overlooked that.
Comment #15
mathankumarc CreditAttribution: mathankumarc commented$flag->status is exists, here is the dump data which I got for the following snippet
echo "<pre>";print_r(flag_get_flag('like'));exit;
Comment #16
IceCreamYou CreditAttribution: IceCreamYou commentedOnce again I stand corrected. The patch in #11 is RTBC and that should resolve this issue.
Comment #17
mathankumarc CreditAttribution: mathankumarc commentedCommitted a fix to dev.
Comment #18
udvranto CreditAttribution: udvranto commentedWill there be any port for 6.x?
Comment #19
IceCreamYou CreditAttribution: IceCreamYou commentedThe equivalent issue for D6 is #682244: Flag 2.x -- I guess the changes would be pretty similar to what was committed in this issue, except that Flag 1.x still needs to be supported. But yes there should be a backport.
Comment #21
Gaurav.Singh CreditAttribution: Gaurav.Singh as a volunteer and commentedIt needs work. I am not able to add like flag from my views, it requires user.nid..but statuses have sid.. Issue in adding flag to views
Please help me out with this issue. I t is allowing to add follow but not like.
As soon I add like flag it gives me this error
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS users_, statuses.sid AS statuses_sid, entity_id AS entity_id FROM statuses s' at line 1
Please find image for the same
Thanks
Comment #22
Gaurav.Singh CreditAttribution: Gaurav.Singh as a volunteer and commentedComment #23
ugintl CreditAttribution: ugintl commentedGaurav use flag 2. It does not work with flag 3
Comment #24
Gaurav.Singh CreditAttribution: Gaurav.Singh as a volunteer and commentedI can not downgrade Flag module..as I am already using that on my website.. Please provide any alternative in statuses module..??