Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I tried to override the Library image style created by the scald_dnd_library.module, but Drupal throws the error "Please only use lowercase alphanumeric characters, underscores (_), and hyphens (-) for style names.", preventing override.
I've attached a patch with corrections to the hook_image_default_styles() to allow override. I would like larger thumbnails in the library.
Comment | File | Size | Author |
---|---|---|---|
#22 | library-image-style-name-fix-2571203-22.patch | 2.14 KB | gifad |
#11 | library-image-style-name-fix-2571203-11.patch | 1.54 KB | nagy.balint |
#4 | scald-dnd-image-style-2571203.patch | 750 bytes | anchovie91471 |
Comments
Comment #2
anchovie91471 CreditAttribution: anchovie91471 commentedComment #4
anchovie91471 CreditAttribution: anchovie91471 commentedComment #5
anchovie91471 CreditAttribution: anchovie91471 commentedComment #7
anchovie91471 CreditAttribution: anchovie91471 commentedOK. My patches suck. Instead of spamming the issues any more, I'll just put the code here and perhaps someone will be willing to create the patch from it.
Line 169 of scald_dnd_library.module
Line 347 of scald_dnd_library.module
Comment #8
nagy.balint CreditAttribution: nagy.balint commentedIndeed that image style machine name should have only contained lowercase letters. As described in https://www.drupal.org/node/1577800
Attached the patch.
However we have to consider backward incompatibility implications. Its a built in style, so in theory it should not have been used by 3rd party. But the possibility is there to be used.
Comment #9
nagy.balint CreditAttribution: nagy.balint commentedComment #11
nagy.balint CreditAttribution: nagy.balint commentedOne more place to modify.
Comment #12
gifad CreditAttribution: gifad commentedFound an issue with scald_gallery module :
scald_gallery.install contains, hard-coded :
This makes ScaldAtomController::save() fail at line 304...
Any better solution than a hack in scald_context_config_load() ?
Comment #13
nagy.balint CreditAttribution: nagy.balint commentedyes, we need to do something with existing data :(
Comment #14
nagy.balint CreditAttribution: nagy.balint commentedI suppose an update hook could work for both modules, and the install can be fixed as well for new installations, but then it can only be fixed in the install once we put a requirement on the scald version after this commit...
Not so simple to do this then.
Comment #15
nagy.balint CreditAttribution: nagy.balint commentedActually i dont think we even need those 3 lines:
Because the render of the representation will not care about that anyways.
If we can simply remove it, then new installs will not have a problem, although the update hook might still be needed to fix old configuration when updating scald.
Comment #16
gifad CreditAttribution: gifad commentedAdded a workaround for existing
'style-Library'
Comment #18
gifad CreditAttribution: gifad commented#16 got corrupted, reroll...
Comment #20
gifad CreditAttribution: gifad commentedHandled redundancies in scald_contexts() structure
Comment #22
gifad CreditAttribution: gifad commentedStupid typo...
Comment #24
nagy.balint CreditAttribution: nagy.balint commentedThanks, Committed.
Comment #26
DuneBLWith this patch, we can change the library style... this is great.
But, it could be nice to have this change reflected into the dnd library as well.
For now, the width of the image is coming from the css:
/modules/library/dnd/css/dnd-library.css b/modules/library/dnd/css/dnd-library.css
But of course, the width of the dnd library should be changed as well...
Comment #27
nagy.balint CreditAttribution: nagy.balint commentedPlease open a new issue with this. Thanks!
Comment #28
DuneBLdone!
https://www.drupal.org/node/2698349