After setting a flag to output as a pseudofield, a manual cache clear is required. This is due to caching in https://api.drupal.org/api/drupal/modules!field!field.info.class.inc/fun....

Conversely, after removing the pseudofield option from a flag, the pseudofield persists in the entity's display options.

Files: 
CommentFileSizeAuthor
#3 2056271.4.flag_.pseudofield-setting-cache-clear-and-refactor.patch5.17 KBjoachim
PASSED: [[SimpleTest]]: [MySQL] 266 pass(es).
[ View ]
#1 2056271.flag_.pseudofield-setting-cache-clear.patch1021 bytesjoachim
PASSED: [[SimpleTest]]: [MySQL] 266 pass(es).
[ View ]

Comments

Status:Active» Needs review
StatusFileSize
new1021 bytes
PASSED: [[SimpleTest]]: [MySQL] 266 pass(es).
[ View ]

Come to think of it, maybe we should tackle #2056275: refactor _flag_clear_cache() parameters first, and THEN fix this, as the current patch won't fix the problem when importing flags.

StatusFileSize
new5.17 KB
PASSED: [[SimpleTest]]: [MySQL] 266 pass(es).
[ View ]

Here's a more dramatic patch which includes the refactoring.

Issue tags:+3.1 blocker

Tagging as 3.1 blocker.

Status:Needs review» Reviewed & tested by the community

I have tested this out. Before the patch, I had to do a manual 'Clear cache' for the field to be removed from my entity type's 'manage display' section. After the patch was applied, the field was automatically removed once I unchecked the 'Display link as a field' option for the flag. So, the patch definitely works and should be committed.

Status:Reviewed & tested by the community» Fixed

Thanks for trying it out!

Committed.

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