When installing commons for the first time, patches to the flag module causes the default flags not to render properly, which throws an error on site:

It only occurs on new installs it seems, and with the patches from the make file applied. When the patches are removed the error goes away. Working to isolate the specific patch causing the issue now.

Comments

japerry’s picture

Title: Default flags in most recent version causes notification page to fail on » Default flags in most recent version causes notification page to fail on install
Assigned: Unassigned » devin carlson

Confirmed that #2027091: Provide a hook_flag_default_flags_alter to allow altering of default definations is the cause of the issue. Since Devin wrote this I'll assign it to him ;-) I keep getting the two patches mixed up. This patch needs a port back to 2.x since the 3.x patch doesn't work properly.

devin carlson’s picture

Status: Active » Needs review
StatusFileSize
new8.78 KB

The Commons Follow submodules (node, user, term, group) currently define their own email_* flags which share the same names as the default email_* flags provided by the Message Subscribe Email module.

Flag uses a nonstandard (neither Entity API or CTools) method of providing default content that has a few issues in Flag 7.x-2.x which are fixed with the patches currently included in the makefile. These fixes result in the default flags provided by Message Subscribe Email being used over the identical flags provided by the Commons Follow submodules (whichever module is called last is used). The Message Subscribe Email default flags are disabled by default, while various code in Commons (mainly views) relies on the flags being available, which is the source of the error messages.

This issue could be solved in a number of ways:

  • Namespace the email_* flags - ideal solution but not feasible due to the "upgrade" path
  • Stop exporting the flags and enable the Message Subscribe Email flags - cleanest solution with the least amount of code
  • Keep the exported flags and alter the Commons Follow submodules default flag hook implementations to be prioritized over the flags provided by Message Subscribe Email - more control in case Message Subscribe Email changes the default flag definitions but most code and more confusing to developers

The attached patch takes the second approach. The email_group flag is left alone since it actually doesn't use the same namespace as the equivalent flag provided by Message Subscribe Email, named email_og, which is why it isn't seen in the error message shown the screenshot.

devin carlson’s picture

Status: Needs review » Fixed

Retested #2 and confirmed that it fixed the error messages appearing on a fresh and an existing install by ensuring that the flags are enabled.

  • Commit 11daa9e on 7.x-3.x by Devin Carlson:
    Issue #2283113 by Devin Carlson: Fixed exported flag namespace conflict...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.