It is possible to populate several fields from multiple args?

Comments

quicksketch’s picture

Title: Great! » Populate multiple fields
Category: support » feature

No, not currently. Obviously such a system wouldn't be able automatically generate node links, since you'd end up with several links to generate every combination of arguments. You can optionally use Prepopulate module to populate several fields. Perhaps some integration might be in order?

christefano’s picture

Category: feature » support

Personally, I'd really like to see Node Reference URL's features in the Prepopulate module. Have you considered merging rather than integrating?

quicksketch’s picture

A lot of functionality is very CCK and node-specific in Node Reference URL Widget. For example, there's a lot of special handling around *how* the links should be generated. While Prepopulate might be able to effectively disable a field if a default is provided in a way similar to Node Reference URL Widget, it would be nearly impossible to determine where to make the links on related content (of course you could try and use Custom Links for this, but there are limitations there also).

No I think these modules make sense as being separate. The amount of overlap is much smaller than it might appear.

jyamada’s picture

I like this module, I hope it grows.

Couldn't we take the weight order of the fields and match the arguments in the URL.
node/add/foo/1/2
cck fields node_reference A uses 1
cck fields node_reference B uses 2

Would this make sense?

I would use it.

quicksketch’s picture

StatusFileSize
new1.27 KB

This approach makes it so that you can specify NIDs via the $_GET string such as:

node/add/story?field_a=10&field_b=20

Which has much less possibility to fail since it's not dependent on the order of the fields. We can discuss if this is the right approach or not, but it definitely works. I'd suggest combining it with Custom Links to manually create your own Create Content links during node display.

baxang’s picture

the patch you suggested works very nicely! Thank you!

quicksketch’s picture

Status: Active » Fixed
StatusFileSize
new1.34 KB

Ultimately I committed this change but made a modification so that the name of the field in the URL is shortened. So if you had a gallery/image set up instead of a url like this: node/add/image?field_gallery=10, you'll now have this: node/add/image?gallery=10. I figure the "field_" prefix is unnecessary considering all Node Reference Fields start with "field_".

quicksketch’s picture

Title: Populate multiple fields » Populate multiple fields through the URL
Category: support » feature
quicksketch’s picture

Version: 6.x-1.0 » 6.x-1.3

Status: Fixed » Closed (fixed)

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

bakr’s picture

Status: Active » Closed (fixed)

From secutrity and for integrity purpose:

Should we require that users not be able to hack the URL, why not use the POST rather than GET?

With Regards

bakr’s picture

Status: Closed (fixed) » Active
quicksketch’s picture

bakr, please open a new issue for your request.

bakr’s picture

Yes, that is a better idea (did not think of it)