Hello,

This patch allows prepopulating ALL forms. Hence, It removes the option in the node-type pages.

Cheers for the great module, it saved me from doing a couple of ugly hacks :-).
- Amr Mostafa

Comments

AmrMostafa’s picture

Title: Prepopulate all kinds of forms, not only node. » Prepopulate all kinds of forms, not only node
Version: 4.7.x-1.x-dev » 6.x-1.x-dev
StatusFileSize
new1.8 KB

Patch updated for HEAD.

Steve Dondley’s picture

Any way you could do a patch for 4.7?

Steve Dondley’s picture

Duh, never mind. It's in the original.

AmrMostafa’s picture

Did it work for you?

Btw, I advice you to use HEAD version of this module, it's 4.7 compatible, and contains some important bugfixes.

eafarris’s picture

Status: Needs review » Needs work

While I do like the concept of this patch, I'm not sure it's ready. First, it's not going to do every form, just those that are part of the $edit array. Secondly, I do appreciate the ability to turn the feature off per node type, though I can't quite think of any examples of where that would be beneficial.

egfrith’s picture

I do like the idea of making the module more general and reducing on configuration which may be unnecessary.

However, I see one potential problem with this patch. If two forms on the same page have identically-named fields, this patch will (I think) cause them both to be populated, which might not be the desired behaviour.

Whether this really is a problem depends on the names that drupal core and all the contrib modules use for their fields, and checking for duplicates would be a considerable undertaking (for me at least). One way to find out might be to have testers try out this patch on their sites and report any problems.

I had a suggested (though not implemented) change to work around this at http://drupal.org/node/81383

moshe weitzman’s picture

well behaved contrib modules should prefix their fields with module name. i don't consider the double fill problem a serious impediment for this feature.

AmrMostafa’s picture

First, it's not going to do every form, just those that are part of the $edit array.

I'm not sure I understand you correctly, but I believe this is to distinguish between values that needs to be populated in the form, and other normal GET values.

Please let me know if you want me to update the patch for HEAD.

egfrith’s picture

Following Moshe's comment, I'm happy to drop my "double fill" concern about this patch.

summit’s picture

Hi,

Did this patch get in the 5.1 branch allready?

greetings,
Martijn

add1sun’s picture

Status: Needs work » Needs review

I think we should go ahead with this change. I've rerolled fresh against HEAD. This will go into 6 as a version 2 of the module. If folks want to retain the old way with the checkbox per content type, they can continue to use v. 1.

If some folks could test this out and do sanity checks, I can work on getting the new version out by the end of the month.

add1sun’s picture

StatusFileSize
new2.3 KB

Hehe, patch being attached helps.

amitaibu’s picture

* Patch applies ok.
* worked ok on content and 'add user' form.
* I wasn't able to prepopualte a comment by using - ?q=comment/reply/4#comment-form&edit[comment]=hello

AmrMostafa’s picture

Should be: ?q=comment/reply/4&edit[comment]=hello#comment-form

amitaibu’s picture

Also with #14 link it doesn't seem to work for me.

christefano’s picture

StatusFileSize
new1.71 KB

This is the patch from #12 that's been backported for the prepopulate-5.x-dev version. It doesn't seem to work with prepopulating the contact form's category field, which I was hoping that this patch would fix.

ygg’s picture

Status: Needs review » Needs work

Great module, but need the full feature that christefano was trying to achieve. The patch needs a little more work. Can someone assist?

add1sun’s picture

In D6 prepopulating the contact form works fine with http://d6/contact?edit[cid]=2. Haven't played with it in 5 but for the purposes of this patch currently we are only focusing on 6 since that is where new features go. Once that is working and in, we can consider backporting to 5.

Comment forms do not however work for me so yes, this does still need work.

paulalbert’s picture

Version: 6.x-1.x-dev » 5.x-1.x-dev

Say I have an event registration page, and it looks like this.

****

Event #1, July 25, 2008 Register Now
Event #2, August 2, 2008 Register Now

****

On click, I want to take the user to a page containing a form, which says:

****

You are registering for: "Event #2, August 2, 2008"

Name:________ [input]
Email:________ [input]

****

Correct me if I'm wrong but this kind of functionality is NOT currently possible with Prepopulate. I tried the patch just above this post and it didn't seem to help matters. If this is the case, are there any alternatives out there?

Thanks for any direction!
Paul

add1sun’s picture

@paulalbert, yeah well that is using prepopulate for text, not a form field so that would be a totally different issue from this one.

add1sun’s picture

Version: 5.x-1.x-dev »

Also moving this issue to 6-2 dev

add1sun’s picture

Status: Needs work » Fixed

I've committed this to HEAD (which is the 6.x-2.x-dev tarball). For now this will go forward and we'll add the caveat that it doesn't work on comment forms. I'll open a separate issue to pursue that.

summit’s picture

Please don't forget the 5.* branch please!
thanks for considering!

Greetings,
Martijn

add1sun’s picture

Version: » 5.x-1.x-dev
Status: Fixed » Patch (to be ported)

Ah, righto then. Setting it to be ported. :)

christefano’s picture

#243471 has been marked as a duplicate of this issue.

Has anyone else tested the backported patch with contact forms on Drupal 5?

a_c_m’s picture

Version: 5.x-1.x-dev » 5.x-1.3

christefano's (comment #16) patch works great on 5.3 with user contact forms .

ezra-g’s picture

The patch in comment #16 also works well for me, allowing me to prepopulate webform data (which does not set the $form['#node'] value and is therefore ignored by prepopulate without this patch).

If the technique used in this patch is satisfactory to the maintainer, this seems RTBC.

add1sun’s picture

Status: Patch (to be ported) » Fixed

Committed to 5.

Status: Fixed » Closed (fixed)

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

patchak’s picture

Hey there, I also managed to prepopulate the "add user" form at "user/register"... but I am not able to do the same thing with the "admin/user/user/create" form.

It would be really interesting to be able to prepopulate that form as well, cause I need site admins to create users easily from a "contact" cck page that contains email field and the name. It would be great if I could pass the user name and the email to that form directly from my "contact" page using a specially formatted link.

IS this possible or the "admin/user/user/create" form is realy not editable??

thanks for your help!
Patchak