Closed (fixed)
Project:
Flag
Version:
6.x-2.x-dev
Component:
Flag core
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Oct 2009 at 19:12 UTC
Updated:
9 Nov 2009 at 21:40 UTC
Jump to comment: Most recent file
Comments
Comment #1
Grayside commentedI found this problem under PHP 5.3 with Zen interacting with the core url() function. In that case, moving the first array element to the same line as the array declaration seemed to fix it.
In other words,
Becomes
Comment #2
amitaibuThe problem was that we tried to create a flag on hook_install, but flag's hook implementation were not used as module wasn't considred enabled.
Patch moves the flag creation to hook_enable().
Comment #3
quicksketchI don't think using hook_enable() is a good way of handling this, as it will cause Flag to re-create a bookmark flag every time the module is enabled. Or worse yet, this would actually *overwrite* existing settings that a user had made to the bookmark flag.
Amitaibu, could you clarify what you mean by "flag's hook implementation were not used"? Does Flag need to have some hooks firing during install?
Comment #4
amitaibuWe won't create another flag, as we have this check.
> Does Flag need to have some hooks firing during install?
Yes - The problem is that module_invoke_all('flag_link_types') doesn't find flag_flag_link_types().
This review is powered by Dreditor.
Comment #5
quicksketchAh, but the problem still exists if the user deleted that flag, it will be re-created by enabling/disabling the module. :-/ Let's use a count(flag_get_flags()) instead, so that if there are *any* flags, we won't recreate the bookmarks flag.
Comment #6
amitaibusounds ok. I'm without dev enviroment (it's the weekend after all) so I won't get to it untill next week.
Comment #7
amitaibuPatch uses flag_get_flags().
Comment #8
quicksketchCommitted. Thanks again Amitaibu!