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)
Files: 
CommentFileSizeAuthor
#2 undefined_index-1833028-2.patch530 bytesmichaelmol
PASSED: [[SimpleTest]]: [MySQL] 39,591 pass(es).
[ View ]

Comments

Issue tags:+Novice

Not an issue for D8.

Version:7.16» 7.x-dev
Status:Active» Needs review
StatusFileSize
new530 bytes
PASSED: [[SimpleTest]]: [MySQL] 39,591 pass(es).
[ View ]

Attached patch with proposed code change.

Status:Needs review» Reviewed & tested by the community

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

Title:Undefined index: image_style in image_style_revert_form_submit() (line 345Impossible 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.

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.

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

Fixing tags accordingly.

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.

Trying to fix the issue tags again...

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 :)

Issue summary:View changes

minor syntax edit.