Is this maybe a regression caused by the splitting up of entity links per view mode?

I'm sure before there was a default for this.

Comments

shabana.navas’s picture

If you mean the default values for the 'Display in entity links' checkboxes, yeah, they did have defaults before. In 7.x-2.x, for something like adding a flag to a node, we had the display in teaser and full view modes selected by default. In 7.x-3.x, none of the default view modes are checked by default.

joachim’s picture

Yup, that's exactly what I mean.

Sorry for the brief summary; I was in the middle of working on another issue and happened to spot this in passing.

shabana.navas’s picture

Status: Active » Needs review
StatusFileSize
new668 bytes

How about checking the first view mode for every entity by default if it is a new flag?

joachim’s picture

Assigned: Unassigned » joachim

Thanks!

This is a good start, but I'd like to have node flags have the 'teaser' as default too. Also, now I've taken a closer look it's probably better to work with the $defaults variable that is being built up before the form element is defined rather than add logic inside that.

And lastly, I'm going to write some tests for defaults on new forms.

joachim’s picture

joachim’s picture

StatusFileSize
new2.85 KB

Argh, I meant to change the current() to reset(), since current() AFAIK could give you a different item in the array depending on what's been done to it previously, so seems a bit more brittle to me.

shabana.navas’s picture

Status: Needs review » Reviewed & tested by the community

Works perfectly.

joachim’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the review :)

Status: Fixed » Closed (fixed)

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