Hi!

I've got an error in Flag module with the 8.x-4.x-dev version.

Notice: Undefined index: tags in flag_entity_view() (line 326 of modules/contrib/flag/flag.module).

I see that the code is using $build['#cache']['tags'], but sometimes cache tags are not present.

I don't know if it would be initialized or be avoided.

Comments

isholgueras created an issue. See original summary.

isholgueras’s picture

StatusFileSize
new697 bytes

I made a patch avoiding the sentence if $build['#cache']['tags'] is not present.

berdir’s picture

Status: Active » Needs work

The correct fix would be to initialize tags to an empty array in that case.

isholgueras’s picture

Status: Needs work » Needs review
StatusFileSize
new552 bytes

Sure,

Here is the patch initializing $build['#cache']['tags'] if it's empty.

Status: Needs review » Needs work

The last submitted patch, 4: cache-tags_2758445_4.patch, failed testing.

The last submitted patch, 4: cache-tags_2758445_4.patch, failed testing.

isholgueras’s picture

StatusFileSize
new532 bytes

Wrong patch path. Here is the correct one.

isholgueras’s picture

Status: Needs work » Needs review
martin107’s picture

go go testbot.

Sorry both of use moved the status to needs review - almost at the same moment.

The last submitted patch, 2: cache-tags_2758445_2.patch, failed testing.

The last submitted patch, 2: cache-tags_2758445_2.patch, failed testing.

berdir’s picture

Status: Needs review » Reviewed & tested by the community

Looks fine to me.

socketwench’s picture

Status: Reviewed & tested by the community » Fixed

Thanks!

Status: Fixed » Closed (fixed)

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