Problem/Motivation

With Commerce Kickstart 2.7 and Workbench enabled, the page admin/workbench/create produces the following error:

Notice: Undefined index: page_arguments in theme_commerce_backoffice_product_node_add_list() (line 219 of ..\profiles\commerce_kickstart\modules\contrib\commerce_backoffice\commerce_backoffice_product.module).

The issue is due to the fact that bean_workbench_create_alter in bean.module does not pass a page_arguments key with a serialized array as a value.

Proposed resolution

A possible solution would be to add a page_arguments key in the $items array in bean_workbench_create_alter. For example:

function bean_workbench_create_alter(&$output) {
$items = array();
$i = 0;
foreach (bean_get_types() as $bean_type) {
if (bean_access('create', $bean_type->type)) {
$items[str_replace(' ', '', $bean_type->getLabel()) . '_' . $i] = array(
'title' => $bean_type->getLabel(),
'href' => 'block/add/' . $bean_type->buildURL(),
'description' => $bean_type->getDescription(),
'localized_options' => array(),
'page_arguments' => serialize(array('bean')),
);
$i++;
}
}

Another approach would be to build a function other than theme_node_add_list that achieves the same goal.

CommentFileSizeAuthor
#1 bean_workbench_create_alter-2008252.patch414 bytesdiarmy
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

diarmy’s picture

Status: Active » Needs review
FileSize
414 bytes

An example patch if anyone is interested.

indytechcook’s picture

Issue summary: View changes
Status: Needs review » Fixed

Thanks, pushed to 7.x-1.x

  • indytechcook committed 150347a on 7.x-1.x authored by diarmy
    Issue #2008252 by diarmy: Error in admin/workbench/create when using...

Status: Fixed » Closed (fixed)

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