Problem/Motivation

Fresh installation of Drupal 7.16 running on php 5.4. Going to configuration -> image styles -> large -> edit. Override and then attempt to revert back fails with message:

Notice: Undefined index: image_style in image_style_revert_form_submit() (line 345 of {path removed}\modules\image\image.admin.inc).
Notice: Undefined index: image_style in image_style_revert_form_submit() (line 346 of {path removed}\modules\image\image.admin.inc).

Resulting in image style not reverting back to its original state.

Proposed resolution

In file image.admin.inc line 329.

function image_style_revert_form($form, $form_state, $style)

adding missing & in $form_state resolves error and reverts back image style

function image_style_revert_form($form, &$form_state, $style)
CommentFileSizeAuthor
#2 undefined_index-1833028-2.patch530 bytesmichaelmol
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

Issue tags: +Novice

Not an issue for D8.

michaelmol’s picture

Version: 7.16 » 7.x-dev
Status: Active » Needs review
FileSize
530 bytes

Attached patch with proposed code change.

michaelmol’s picture

Status: Needs review » Reviewed & tested by the community
minida28’s picture

It hurt both my local and production drupal sites, but the proposed solution works really well, thanks !

In my local devel:
Drupal 7.17 on XAMPP 1.8.1 for Linux (PHP 5.4.7)

Production:
Drupal 7.17 on PHP 5.3

David_Rothstein’s picture

Title: Undefined index: image_style in image_style_revert_form_submit() (line 345 » Impossible to revert image styles when using PHP 5.4
Priority: Normal » Major
Status: Reviewed & tested by the community » Fixed

Committed to 7.x - thanks! http://drupalcode.org/project/drupal.git/commit/2f00fb3

Looks like a very similar issue to #1614292: image_style_delete_form doesn't take form_state by reference...

I also looked into why this isn't in Drupal 8, and it seems to just be gone. #1398040: Detect if default configuration of a module has been changed, and allow to restore to the original is the issue to discuss that further.

David_Rothstein’s picture

Drupal 7.18 was a security release only, so this issue is now scheduled for Drupal 7.19 instead.

Fixing tags accordingly.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

David_Rothstein’s picture

Drupal 7.19 was a security release only, so this issue is now scheduled for Drupal 7.20 instead.

Fixing tags accordingly.

David_Rothstein’s picture

Drupal 7.20 was a security release only, so this issue is now scheduled for Drupal 7.21 instead. For real this time... I think :)

Fixing tags accordingly.

David_Rothstein’s picture

Trying to fix the issue tags again...

David_Rothstein’s picture

Issue tags: +7.22 release notes

Fixing tags since Drupal 7.21 only contained a fix to deal with fallout from the Drupal 7.20 security release. Hopefully this is really the last time I do this and this will be released in Drupal 7.22 for real :)

David_Rothstein’s picture

Issue summary: View changes

minor syntax edit.