Until now, Node Relationships has been using the following path to render the node edit form on child Modal Frames:

- noderelationships/create/[referrer_type]/[field_name]/[new_type]

This may cause issues with other modules, as seen on this issue related to Hierarchical Select: #582508: HS + noderelationships + modal frame api

The problem is that some modules may rely on the node/add path to perform their job, because they "watch" for this particular path, or because the menu system will automatically load node.pages.inc.

If we can tweak enough the output of node/add so that it can be rendered on a Modal Frame keeping the context information that we need to perform our own job, then we'll probably solve compatibility issues with other modules.

Patch coming...

Comments

markus_petrux’s picture

Title: Use node/add path to create nodes within the Modal Frame » Redirect to node/add/[type] when creating nodes within the Modal Frame

Better title.

markus_petrux’s picture

Status: Active » Fixed
markus_petrux’s picture

Priority: Normal » Critical
Status: Fixed » Active

Ugh! It seems there are cases where the Modal Frame remains open with the loading animation in an endless loop. This is because this patch fails to check a few cases where the child stuff of the Modal Frame should be triggered.

I'm marking this critical because I just released a new version with these changes. :(

I'll try to work on a patch as soon as possible. Sorry for the headaches it may cause.

markus_petrux’s picture

Ok, fix committed to CVS. It was just the call to include Modal Frame stuff in the child window for the node add form that had to be done within the pre_render callback so that the form is rendered correctly in case of validation errors, where hook_form_alter() is not involved.

http://drupal.org/cvs?commit=308346

Again, apologies for the headaches this issue could have caused to you all.

I'm going to create a new release in a moment.

markus_petrux’s picture

Status: Active » Fixed

It seems the fix above was not completely correct. :(

Here's a follow up patch. This time, I'm calling modalframe_child_js() from noderelationships_init(), and I hope this fixes the issue, finally.

http://drupal.org/cvs?commit=309460

This time, though, I'll wait a little to see if someone else can confirm the fix before creating a new release.

markus_petrux’s picture

FYI: Here's how to identify when a node/add page is being loaded within a modal frame implemented by Node Relationships module. The path looks like this:

node/add/NODETYPE?noderelationships_referrer_type=NODETYPE&noderelationships_field_name=field_noderefence

Status: Fixed » Closed (fixed)

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

AgaPe’s picture

Hi Markus,

I would like to apply your patch but i am unfamiliar with cvs, could you please tell me which one should i apply?
under dates there are different links, plus there are different link under different dates and as i see newer patches add something but they do not contain the previous ones so i got a bit lost seeing http://drupal.org/cvs?file=/modules/noderelationships/CHANGELOG.txt

AgaPe’s picture

Oh yea i see these are different files, i checked the patch from #5 but it was already included in the module, so why the hs is not working?

AgaPe’s picture

Added the patches from 18th and 25th Jan but HS in the Modal Frame is not working still...
Would be very thankful for any help!