Message of the day:
SS 4.4.2 is out. Changelog: https://github.com/silverstripe/silverstripe-framework/blob/4/docs/en/04_Changelogs/4.4.2.md
SilverStripe 4 related information and questions.
hi all, i use an uploadfield to upload an mp4 video. It uploads fine, but when i navigate to another page and upload a video there too and navigating back to my first page. On the first page it shows the filename from the second page. Reloading the page shows the correct file. Does anybody have a clue on how to fix this?
To answer the specific question, you'd almost certainly need to add an extension to do it I think
I looked (fairly briefly) at something similar before, and struggled to work out how to do it... so if you work it out, please share! In my situation I needed to go the other way so I could perform some masking operations on the image... due to time constraints I ended up having to just restrict the upload field to PNG files 😞
I know i would lose transparency, but have some narly photos uploaded as pngs
is there a way to change uploaded pngs to jpgs, or will I need to add an extension for that. Would that mess up anything changing the extension in regards to caching the output of any padding/fill etc operations?
@Nick Actually.. Cars is a has_many relation linked to a member. From Member I need to find all linked (and latest version of) cars. Normally, without versioning, just using $member->Cars() would be what I need, but that isn't returning all the cars that I need. So basically, is there a pretty way to query a has_many relationship with versioning?
And I don't mind writing a custom query, but I just would like to prevent that as much as possible 🙂
You can do something like
- Versioned::get_by_stage('Car', Versioned::LIVE)->filter('MemberID', $member->id)->get()
or however the relation is setup
Thanks! I was seriously overthinking it.
@Tamara just fetch as normal, by default the records will be the latest versions.
unless you mean regardless of published status AND you're in "live" mode, in which case you'll need to switch the query context first as @Nick has indicated :)
I actually also need to retrieve archived versions, so that wasn't an option for me 🙂
Yes 🙂Thanks though!
Hi all, I've got a DataObject (Cars), which has versioning on it. What's the best way to get all car objects (in which each record is only showing the latest version)?
n/m, found the site was running the wrong php version
any idea why I'm getting an error
Uncaught Error: Class 'DOMDocument' not found?
be careful not to set these on a production site ;)