When starting a batch job, a token is generated and this token is session-bound. This means that if you start a batch job, logout and then login again, you're not able to see the progress indicator on the batch-page, e.g.: /batch?op=start&id=15

Bind to current user instead of session.

Comments

patrickd’s picture

Status: Active » Closed (won't fix)

I'll close this, as Better Batch now handles this feature.

gielfeldt’s picture

Status: Closed (won't fix) » Active

I'll reopen this ticket, as this should work for background batch even without better batch

patrickd’s picture

Okay, so as background batch does replace (not wrap like better batch) this is quite easy to implement

  • we have to save the uid when the batch is build (hook_batch_alter)
  • remove checking the session hash (from drupal_get_token) from /batch page callback when batch is loaded from database
  • check the UID instead

If you've not started yet, I can make these changes and create a patch tomorrow!

gielfeldt’s picture

Ok. Sounds exactly how I planned to implement it. I haven't begun yet. You're welcome to create a patch.

patrickd’s picture

Status: Active » Needs review
StatusFileSize
new1.52 KB

all right :)

gielfeldt’s picture

Status: Needs review » Reviewed & tested by the community

Looks good and works for me. Do you wanna commit yourself, so you'll appear as the committer?

patrickd’s picture

Status: Reviewed & tested by the community » Patch (to be ported)

Makes no difference to me, but I'll do it ;)
I'm not experienced about 6.x; can this be applied without problems there?

gielfeldt’s picture

More or less. I can port it afterwards.

patrickd’s picture

okay, committed to 7.x-1.x and 8.x-1.x.

gielfeldt’s picture

Hmmm ... this is probably more "less" than "more" due to Drupal 6 not having a hook_batch_alter() :-)

I'll find a way though.

gielfeldt’s picture

Assigned: Unassigned » gielfeldt
gielfeldt’s picture

Status: Patch (to be ported) » Fixed

Committed to 6.x-1.x-dev

ikeigenwijs’s picture

I hope/think this will solve my problems witch consecutive batches runs. in I'm developing for 6.22.

Status: Fixed » Closed (fixed)

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