rolandtoth / AdminOnSteroids

Various ProcessWire admin tweaks to boost productivity.
https://processwire.com/talk/topic/13389-adminonsteroids/
GNU General Public License v2.0
39 stars 10 forks source link

Field edit link added twice for radios inputfield #96

Closed Toutouwai closed 6 years ago

Toutouwai commented 6 years ago

On a Page Reference field using a radios inputfield, the field edit link seems to be added twice. This causes a gap between the inputfield header and content.

2018-06-05_130824

2018-06-05_130945

rolandtoth commented 6 years ago

I've fixed it without further examining the root cause (with a simple strpos if).

The spacing issue was not caused by this but by the uikit css rule *+ul { margin-top: 20px; }. Appending the edit link instead prepending fixed this.

Toutouwai commented 6 years ago

Great, thanks!

I've fixed it without further examining the root cause

I think the cause is that Page Reference fields are a combination of two inputfields: InputfieldPage and whatever inputfield type is selected in the field settings, meaning the method gets called twice for Page Reference fields. So alternatively you could exclude InputfieldPage, but the way you've fixed it is good because that would cover it in case there are any other fields that render more than one inputfield.

rolandtoth commented 6 years ago

Ok, thanks for the explanation. I was thinking something like that but I was lazy to dig deeper.