Im using a module (message_subscribe) that comes with defined flags.
I'm using hook_flag_options_alter() to change these flags.
I'm using $flag->types = array (0 => 'idea', 1 => 'project',); to set what bundles these flags belong to.

When I go to flags admin page (admin/structure/flags) i can see both flags appearing next to my flag type. In the DB in table flag_types they appear once.

I do not found any functional issues.

This might be related to this issue: https://www.drupal.org/node/1700268

Comments

joachim’s picture

Status: Active » Postponed (maintainer needs more info)

> When I go to flags admin page (admin/structure/flags) i can see both flags appearing next to my flag type. In the DB in table flag_types they appear once.

I'm not sure what you mean by this.

Could you describe what you see that you think is not working properly please? How should it work?

bsandor’s picture

Hi,

Let's say I want my flag appear on article and page so I use $flag->types = array (0 => 'idea', 1 => 'project') when setting flag up.

When I go to the DB I can see one line for each content types. This is fine.

When I go to admin/structure/flags i can see: article, page, article, page in Entity Bundles of my flag however I should see article, page.

joachim’s picture

Version: 7.x-3.3 » 7.x-3.x-dev
Category: Task » Bug report

I tried reproducing this, and I did see the doubling effect, but only on one flag, and it went away after I edited and save the flag.
Now with the code still in place it works fine.

Could you try debugging the flag object before and after your change? Also, be sure to use the latest version of Flag.