Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Sonya* Posted January 8, 2020 Posted January 8, 2020 I have created a custom field in database of type Upload (Allow multiple). I would like to display uploaded images in the Lightbox widget. In the description of Display custom field is stated: If using mulitple uploads, $value is an array of File Objects. However it seems to be an array of strings and not File Objects, as this code fails: Error: Call to a member function thumbnail() on string (0)
TheJackal84 Posted January 9, 2020 Posted January 9, 2020 Try loading the file $image = \IPS\File::get( 'theStorageLocation', $value ); Then $image->url etc etc
Sonya* Posted January 9, 2020 Author Posted January 9, 2020 1 minute ago, TheJackal84 said: Try loading the file $image = \IPS\File::get( 'theStorageLocation', $value ); I've already done. This is just a kind of "bug" submission that docs in description is wrong. 😉
Daniel F Posted January 9, 2020 Posted January 9, 2020 The upload field is behaving different within pages, please see ( just mentioning it here for the people which find this topic via the search ) I guess we could and should update the description 🙂
Recommended Posts
Archived
This topic is now archived and is closed to further replies.