Similar to the previous bug, #283475: "Node add form" context not creatable from UI, the problem here too is in the form function. But now it's in faulty parsing of the autocomplete NID field.

Since this parsing appears in three places[1], I factored it out into a separate utility function, panels_parse_autocomplete_nid(), which I put in 'panels.module'.

[1] contexts/node.inc, contexts/node_edit_form.inc, panels_node_legacy/panels_node_legacy.module.

CommentFileSizeAuthor
parse_autocomplete.diff5.29 KBmooffie

Comments

mooffie’s picture

But now it's in faulty parsing of the autocomplete NID field.

I should've been more specific:

The problem is in 'contexts/node_edit_form.inc', in panels_context_node_edit_form_settings_form_validate():

  1. The `$form_values['node']` field is in autocomplete syntax (e.g. ".... [nid: 123]"), but as can be seen in the source, no parsing is done; so the NID isn't extracted correctly and this validation function fails.
  2. The valid NID isn't stored back in $form['nid'].

The patch fixes these two problems.

sdboyer’s picture

Status: Needs review » Fixed

Nice job with this. I've committed the patch you posted here (with just small changes to the function title - it's now panels_nid_autocomplete() ) because I want it in for RC and it fundamentally works. I hope, though, that we can add some UI-based feedback with this, because at the moment the title-based autocomplete still comes up even when putting in the number, and it's rather confusing. If you have time to work on such a thing, that'd be awesome :) If you do, go ahead and open another issue for it.

Thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)

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