Just tried the 7.x branch - which is a fantastic step forward.

One error I've found when selecting node types generated by other contib modules (Panels & SimpleAds) and one custom content type (that contains a title, an image and a URL field) :
Notice: Undefined variable: field_names in multi_node_add_page() (line 64 of .../multi_node_add/multi_node_add.pages.inc).

Which is within in this snippet:

    $form['fields_to_utilize'] = array(
      '#type' => 'checkboxes',
      '#options' => $field_names,
      '#title' => t('Fields to manage'),
      '#attributes' => array('class' => array('multi-node-add')),
      '#description' => t('Choose those fields that you would like to edit on the new nodes'),
    );

And $field_names is initialised by field_info_instances('node', $type); at line 32. For the 3 referenced cases, the array $field_names is empty, hence the error, when viewing /node_multi_add/node_type

CommentFileSizeAuthor
#5 multi-node-add2.png34.46 KBrobcarr
#2 multi-node-fail.png20.81 KBrobcarr

Comments

aron novak’s picture

Status: Active » Needs review

Thank you for the detailed and exceptionally clear bugreport, i committed a fix now:
http://drupalcode.org/project/multi_node_add.git/commit/338347f

Let me know if it helps!

robcarr’s picture

Status: Needs review » Needs work
StatusFileSize
new20.81 KB

Seems to work well and spot-on for my needs. The message "Failed to detect usable fields" is helpful, but may not mean much to a content administrator.

In such cases the form to create a number of rows should be hidden (as the form submission generates an error), and a more direct message: "Unable to create multiple nodes of this content type" if no fields are available... or even hide the tab for that content type (although you might see downstream issues of 'Why doesn't it detect my content type?" being posted).

aron novak’s picture

Status: Needs work » Needs review
aron novak’s picture

and it's rewritten to use drupal_set_messages()

robcarr’s picture

StatusFileSize
new34.46 KB

Fantastic! My only thought is that the error message is still a bit of a 'so what?' as it doesn't inform the user why the error is generated and what impact it has on the ability to generate multiple nodes. The warning notice can sometimes convince the user that they've done something wrong, when it's actually a technical issue, possibly out of their control.

How about 'Unable to generate multiple nodes for this content type (failed to detect usable fields).' as a message? More a usability issue than a technical concern.

aron novak’s picture

Indeed, thanks for taking care of such UX aspects, i updated the text.

robcarr’s picture

Status: Needs review » Fixed

Looks like it's a sorted problem. Thanks for updating the latest DEV release too.

Status: Fixed » Closed (fixed)

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

  • Commit 338347f on 7.x-1.x, 8.x-1.x by Aron Novak:
    #1761808 reported by arrrgh : handle the situation when there are no...