[Upload different image] button under a slide's current image.

I have slides with lots of info in the fields. I want to change the image without deleting it, making a new one, and re-entering all the info.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Devin Carlson’s picture

Status: Active » Closed (won't fix)

I'd like to keep the slider administration interface simple and straightforward.

You can upload another image and simply copy + paste over any preexisting settings.

tmsimont’s picture

Status: Closed (won't fix) » Active

personally I think that requiring the admin to remove and copy/paste all of that info into a new slide is as far from "simple and straightforward" that you can get. It makes a common task about 5 times harder than it should be. I think I might try to alter this and put up a patch

tmsimont’s picture

Status: Active » Needs review
FileSize
3.51 KB

Patch attached for dev version. This could use some further testing.

tmsimont’s picture

Title: Change Image » Allow user to update, replace or change image field

Updating title to be more SEO friendly in case others like me were searching for "update" and "replace" instead of "change"

Also -- below is a brief description of what that patch I attached above does exactly:

add file_usage_add() to the install update process and image save process so the image uploaded to the slideshow properly utilizes the file_usage table. This will help the file system understand why this file exists, and more importantly, allow it to be used in a "managed_file" form field field element.

adds a "managed_file" "new image" field to the nivo slider settings form that will allow the user to replace the image. when the FID of the "new image" is not the same as what is set as the FID of the slide, the old image is deleted and the new one replaces it.

@see file_usage_add()
@see Form API: managed_file

Devin Carlson’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
tmsimont’s picture

why 8.x?

ami7878’s picture

FileSize
1.31 KB

This patch worked perfectly for me and is a real lifesaver. I had only one problem though.

All is good if you install nivo_slider with the patch but if you install the patch on a site already using nivo_slider with some slides already set, the slides configuration form fails validation (due to the missing entries in the file_usage table.

Obviously, if you know your way in the database you can manually fix this but for those who don't and/or for those (like me) who have this module installed on many sites, I created the attached module (nivo_fix) that will fix the issue. Onced fixed, the module can be disabled and removed.

IMPORTANT: This module should only be used with the above patch!