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

Disable Filename Truncation does not work when field is required #84

Closed gingebaker closed 6 years ago

gingebaker commented 6 years ago

Hi

Found one issue with the FileFieldTweak "Disable Filename Truncation"

If the file field for example is required it will not add the noShortName = 1. This is because you are using the $event->object->class for checking. This variable will have the value "FieldtypeFile required", wich will not pass the if statement.

You could change the if statement here: https://github.com/rolandtoth/AdminOnSteroids/blob/master/AdminOnSteroids.module#L1384 to:

if ($event->object instanceof FieldtypeFile) {
   return;
}

Thx for this great module!

rolandtoth commented 6 years ago

This is a much better check, thanks! Will be included in the next update.