I'm getting a "Undefined index" notice on PHP 5.3 running a custom command:

WD php: Notice: Undefined index: drush_batch_process_finished in _drush_backend_batch_process() (line 39 of /opt/drush/commands/core/drupal/batch_6.inc).

Here's patch to fix that.

Comments

moshe weitzman’s picture

Assigned: claudiu.cristea » greg.1.anderson
Status: Needs review » Reviewed & tested by the community

Looks fine to me. I'll let Greg review and commit.

greg.1.anderson’s picture

Status: Reviewed & tested by the community » Fixed

Committed a slight variant of the proposed patch.

Status: Fixed » Closed (fixed)

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

Tor Arne Thune’s picture

Title: PHP 5.3 notice » Undefined index: drush_batch_process_finished
Version: All-versions-3.3 » 7.x-4.4
Status: Closed (fixed) » Needs work

Still getting this in Drush 4.4.

greg.1.anderson’s picture

Assigned: greg.1.anderson » msonnabaum
Status: Needs work » Patch (to be ported)

This was only fixed in 5.x-dev. It could be backported, though.

jonhattan’s picture

Version: 7.x-4.4 »
Assigned: msonnabaum » Unassigned
Status: Patch (to be ported) » Needs review
StatusFileSize
new1.28 KB

It was fixed only for batch_6.inc... but it seems to me it was not a proper fix.

$data['context']['drush_batch_process_finished'] is not declared anywhere but used in that line. It seems a lapsus when coding this because what is done in other part is drush_set_option('drush_batch_process_finished').

Why it didn't produce a failure never? Perhaps checking for !$data is enough.

Tor Arne Thune’s picture

Priority: Normal » Major
StatusFileSize
new24.9 KB

When I apply the patch in #6 to Drush 4.5-rc1, and run drush upc --no-core -l example1.com it goes into an endless loop. See attachment for debug.

Changing this to Major, as it completely leaves me without the drush upc functionality.

Tor Arne Thune’s picture

StatusFileSize
new24.9 KB
jonhattan’s picture

Status: Needs review » Fixed

The lapsus was from me in #6. drush_set_option('drush_batch_process_finished') is set in a backend process and obtained in the main project throught $data['context'].

fixed in master.

jonhattan’s picture

Version: » All-versions-4.x-dev
Assigned: Unassigned » msonnabaum
Status: Fixed » Patch (to be ported)
StatusFileSize
new679 bytes
Tor Arne Thune’s picture

The patch in #10 works great when applied to Drush 4.5-rc1 :) No longer an issue with this patch.

pcambra’s picture

suscribe

pcambra’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new662 bytes

Here's the patch ported to 4.4 (modifying the batch_7.inc file)

maciej lukianski’s picture

Assigned: msonnabaum » Unassigned
StatusFileSize
new654 bytes

I rerolled it for drush 4.5

moshe weitzman’s picture

Status: Needs review » Fixed

Committed to 4.x

Status: Fixed » Closed (fixed)
Issue tags: -php5.3

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