adrianbj / CustomUploadNames

ProcessWire module to automatically rename file (including image) uploads according to a configurable format
GNU General Public License v2.0
10 stars 2 forks source link

fix Trying to get property of non-object in some cases #9

Closed mavmedved closed 5 years ago

mavmedved commented 5 years ago

Hi! In some cases, this might be a problem. For example, I add a file through api with given full path: $page->of(false); $page->image = '/root/file/path/image.png'; $page->save();

and the error occurs. I actually do it in my module and I can't cancel your hook when I really need it. Settings are irrelevant, I still need CustomUploadNames to hook for this field when I edit it in the admin panel.

Thank you for your module!

adrianbj commented 5 years ago

Hi @mavmedved - thanks for your efforts here. Unfortunately I had already moved a bunch of code around and actually had to fix this a different way, but hopefully should be all working in the latest version. Please let me know how it goes for you.