I’m having a really hard time trying to get versioning on files in SS4.
The documentation isn’t right, these 2 pages claim different things about how to set
FlysystemAssetStore) but the actual config var seems to be on
AssetControlExtension, and I can’t seem to get it to keep replaced files with any of them set. I’m not even sure if it’s the setting I need.
In SS3 we had a History tab on files which let us download all previous versions, is there a way to achieve this in SS4? Ideally stable SS4.3, haven’t tried the latest/unstable SS4.4
File versioning, as far as I'm aware, does not yet let you view the history
There's a global archive section that does this.
Right. /me runs
apt-get update;apt-get upgrade FileVersioning
Okay I can show history again using
- show_history: true
But I still can’t work out how to get files to actually keep previous versions, currently the earlier versions in the history tab just send me to the latest copy on disk and the older versions have been deleted.
what version? Have you checked to see if there are open issues on GitHub? Would you like to log an issue on GitHub if not? Have you tried upgrading to 4.4? Did you know the upgrading tool (
silverstripe/upgrader) can help upgrade between minor versions, not only just 3 -> 4?
althoug 4.4 will be
4.4.x-dev at current I believe (4.4.0 yet unreleased)
My issue is with a lack of documentation, I’m not sure what I need to do to make SS not delete the old versions of files when a new replacement is uploaded (if it’s still possible). I haven’t tried 4.4 as I’d rather use “stable” in production.
4.4 is due in the next few weeks, and includes all the work on files that might see your problem disappear :)
In short, I'm not sure either sorry, but perhaps you could try the new version, I know the team that did the work are actively looking for "real world" test cases and feedback at the moment :)
It would be ideal if a partner could be a part of that too :) Even if the feedback is "omg problems gone, yay!"
if not, that would be very welcome too.
@nightjarnz (I'm fine with being ping directly on Slack, when people feel I'm the most competent person to answer a question )
Yay :D Well, there are queries about file migration, and I am trying to encourage Matt here to give 4.4 a "live" (read: real world data set, not in production) test for you.
To keep your files archived add something like this in your YML config.
- keep_archived_assets: true
This extension is applied to
DataObject ... by setting it on
AssetControlExtension, you're setting on
File as well.
In theory, setting it directly on
File should work as well, but I haven't tried it.
If you wanted to really make your life complicated, you could enable archive on
Image, but disabled it on
About viewing archived Files, to my knowledge we don't provide an interface for that. However, if you are looking at an old version of SiteTree object that reference a prior version of a File, that record should be considered a dependent record, so it should be showing there and be restored along with the page.
That is, if the File is inserted through a WYSIWYG.
If your File is reference through a
has_one/has_many relationship, you might have to define an ownership relation.
I'm not 100% about those last two points ... I may be making things up.
Elsewhere I’ve gotten around this with
But because it’s a
many_many relation I don’t easily have the ID of the related model. It’d be nice if there were something available like
Is there a way I can make sure I get a link without
?stage=stage? I’m using
$myModel->MyRelatedPages()->first()->Link(). What I want is just the normal link to the latest published version of that page, not with
Is there a way of applying an extension to a class just for a particular phpunit test?
I’ve got a TaxonomyTermUrlExtensionTest as part of the Taxonomy module, and I need to apply this extension to be able to test it:
- - SilverStripe\Taxonomy\Extensions\TaxonomyTermUrlExtension
I’ve tried adding that as a fixture
.yml but it doesn’t seem to apply it. I’ve tried adding this in the
- Extensible::add_extension(TaxonomyTerm::class, TaxonomyTermUrlExtension::class);
Which seems to apply the extension but doesn’t re-build meaning it doesn’t add the db column before the test runs (i.e. the mysql error here https://travis-ci.org/silverstripe/silverstripe-taxonomy/jobs/531541126)
I don’t want to add the extension using the module’s
_config/*.yml or else it will always add it for everyone (or at a minimum for all tests), whereas it should be optional.
Any other ideas?
Thanks. How does Platform do system logging? CWP uses greylog
What are the differences between CWP and SilverStripe Platform? I understand the hosting difference (Rivera/NZ vs AWS), are there other differences in the services included?
Ahhh, worked it out, needs to be
- After: services-addon-name/routes#serviceroutes
Is is possible to re-route a director rule? e.g. if some addon has a routes.yml like this
- Name: serviceroutes
- After: framework/routes#coreroutes
- '//services/$Action/$ID!' : 'ServicePage_Controller'
is it possible to direct that url to your own controller with something like this?
- Name: specialserviceroutes
- After: 'serviceroutes'
- '//services/$Action/$ID!' : 'SpecialServicePage_Controller'
Can’t seem to get it to ever use my controller
Wouldn’t have to be super timely, regular email times would be fine. Also looking at other options but will note that fact for the decision makers.
I’m just looking at options for a possible alert service, which could need to send thousands (or possibly up to 10s of thousands) of unique emails per day to thousands of registered users.