View more context

 

sb

Thanks 😉 We are looking for a self hosted solution. We have some sites using Thumbor (http://thumbor.org/) with rewriting image urls to point to the thumbor server. I was just wondering if someone has different approaches 🙂

Show 1 attachment(s)
thumbor - open-source smart on-demand image cropping, resizing and filters

Thumbor is a smart imaging service. It enables on-demand crop, resizing and flipping of images. It features a very smart detection of important points in the image for better cropping and resizing, using state-of-the-art face and feature detection algorithms (more on that in Detection Algorithms).

Hide attachment content
Ed Linklater

The only thing I've done in the past was onAfterWrite on DataObjects that attach images, pre-generating the common sizes

Ed Linklater

you could potentially combine that approach with queuedjobs to run a queue that generates all the image sizes you use

Ed Linklater

that way you're not trying to generate too much within a single HTTP request

wmk

When I have a manymany relation and someone deletes the related DataObject, is it supposed to clean up the many_many relation table? Or do I need to remove the items from the ManMany relation manually?

wmk

but then it deletes the related items... In my case someone deleted on the belongs_manymany site; it didn't clean up; now if I add a new item and it accidently has an old ID it's automatically related to the old relations

Ed Linklater

a new object shouldn't get an old ID unless you've reset the auto_increment on the table

Ed Linklater

the DB maintains its own counter, it doesn't just take the highest ID and add 1 to it

Ed Linklater

(for MySQL/MariaDB anyway, I can't speak for other DBs)

wmk

seems it got an old ID after moving a DB to a new server (from test to live or so).

wmk

for the record: in delete(), $this->ManyManyRelation()->removeAll() cleans up the relation table when deleting.

Ed Linklater

ah - gotta make sure you include auto_increment value of tables in your SQL dump

wmk

dunno if sspak or phpmyadmin do that by default

Ed Linklater

the mysqldump command does it by default, which I think sspak uses

wmk

but theoretically a hook to loop over all manymany relations and cleans up would be an improvement, wouldn't it?

Ed Linklater

in other ORMs it would be natural, but it kinda goes against the "playing it safe" nature of the SS ORM in my opinion

wmk

for the record, here is an old issue about it: https://github.com/silverstripe/silverstripe-framework/issues/5290 manymany through with cascade deletes would be the way to go

Show 1 attachment(s)
GitHub  
Clean up DB deletion queries · Issue #5290 · silverstripe/silverstripe-framework

Quite some time ago there was some debate around cleaning-up intermediary relations when one or the other side of a ManyMany relation was deleted, for internal consistency. The arguments for this a...

Hide attachment content
Ed Linklater

yeah, I think using the cascade deletes feature is best because that way it is developer-specified and not "magic" data deletion that the developer doesn't know about


Show less replies
Eduard Ichim

Is SS4 configuration of max upload size only taken from php.ini or is there also some sort of .env variable you have to provide/configure?

Ed Linklater

you can specify it on UploadField/FileFields, and there's also the max_post_size in php.ini not just max_upload_size

Eduard Ichim

Yes I was thinking about both of them in php.ini that is why I didn't give the variable (lazy). Thanks

Eduard Ichim

That is all I needed to know, I think my ini is just cached

lerni

or got the wrong one (common pitfall) - check with phpinfo()

nightjarnz

Has anyone actually managed to alter the format for a DateField and had that store/redisplay correctly?

wmk

I use that silverware calendar module instead of DateField.

nightjarnz

🤔 I'll take a look. I'm not having troubles showing the calendar - I'm having trouble with the field and the complex formatting it does on submission. If there's an error in the form for example, the field comes back quite out of sorts. E.g. 05-11-2019 => 11-00-2021