When attempting to run a Bulk Generate to content for some changes to patterns, I am encountering an AJAX error page:

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /batch?id=18289&op=do_nojs&op=do
StatusText: parsererror
ResponseText: 
( ! ) Warning: max(): Array must contain at least one element in /home/vagrant/Code/seic/modules/contrib/pathauto/src/Plugin/pathauto/AliasType/EntityAliasTypeBase.php on line 185
Call Stack
...

The line of code is $context['sandbox']['current'] = max($ids);. Changing it to $context['sandbox']['current'] = !empty($ids) ? max($ids) : 0; should help.

CommentFileSizeAuthor
#2 pathauto-2932432-2.patch770 bytesdbgilbert
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dbgilbert created an issue. See original summary.

dbgilbert’s picture

updated org

Berdir’s picture

Status: Active » Needs review
DrColossos’s picture

Status: Needs review » Reviewed & tested by the community

Had the same issue, the patch fixed it without problems and applied cleanly

Berdir’s picture

Status: Reviewed & tested by the community » Fixed

Feels like this fixes the visible error and not a possible underlying problem, but if it helps, committed.

  • Berdir committed 1e940d4 on 8.x-1.x authored by dbgilbert
    Issue #2932432 by dbgilbert: Bulk Generate: ajax error due to warning...

Status: Fixed » Closed (fixed)

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