rolandtoth / AdminOnSteroids

Various ProcessWire admin tweaks to boost productivity.

Home Page:https://processwire.com/talk/topic/13389-adminonsteroids/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Disable Filename Truncation does not work when field is required

gingebaker opened this issue · comments

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!

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