Prepopulate all kinds of forms, not only node

alienbrain - December 7, 2006 - 12:53
Project:Prepopulate
Version:5.x-1.3
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

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

AttachmentSize
prepopulate_all_forms.patch.txt1.92 KB

#1

alienbrain - December 7, 2006 - 13:06
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

Patch updated for HEAD.

AttachmentSize
prepopulate_all_forms_HEAD.patch.txt 1.8 KB

#2

Steve Dondley - December 9, 2006 - 04:33

Any way you could do a patch for 4.7?

#3

Steve Dondley - December 9, 2006 - 04:34

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

#4

alienbrain - December 10, 2006 - 09:33

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.

#5

eafarris - January 27, 2007 - 20:42
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.

#6

egfrith - January 28, 2007 - 22:23

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

#7

moshe weitzman - April 15, 2007 - 19:40

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.

#8

alienbrain - April 18, 2007 - 01:31

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.

#9

egfrith - April 20, 2007 - 09:39

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

#10

Summit - September 3, 2007 - 12:01

Hi,

Did this patch get in the 5.1 branch allready?

greetings,
Martijn

#11

add1sun - March 16, 2008 - 15:21
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.

#12

add1sun - March 16, 2008 - 15:22

Hehe, patch being attached helps.

AttachmentSize
prepopulate_all-forms-101916-11.patch 2.3 KB

#13

Amitaibu - March 17, 2008 - 17:55

* 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

#14

alienbrain - March 17, 2008 - 18:17

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

#15

Amitaibu - March 17, 2008 - 20:06

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

#16

christefano - April 9, 2008 - 03:34

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.

AttachmentSize
101916_prepopulate_all-forms_5.x.patch 1.71 KB

#17

ygg - April 9, 2008 - 03:35
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?

#18

add1sun - May 3, 2008 - 18:38

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.

#19

paulalbert - June 11, 2008 - 18:53
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

#20

add1sun - June 23, 2008 - 14:32

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

#21

add1sun - June 23, 2008 - 14:32
Version:5.x-1.x-dev» 6.x-2.x-dev

Also moving this issue to 6-2 dev

#22

add1sun - June 23, 2008 - 14:51
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.

#23

Summit - June 23, 2008 - 18:15

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

Greetings,
Martijn

#24

add1sun - June 23, 2008 - 18:51
Version:6.x-2.x-dev» 5.x-1.x-dev
Status:fixed» patch (to be ported)

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

#25

christefano - July 25, 2008 - 21:27

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

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

#26

a_c_m - October 19, 2008 - 18:25
Version:5.x-1.x-dev» 5.x-1.3

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

#27

ezra-g - November 3, 2008 - 05:18

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.

#28

add1sun - November 17, 2008 - 17:53
Status:patch (to be ported)» fixed

Committed to 5.

#29

System Message - December 1, 2008 - 18:01
Status:fixed» closed

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

#30

patchak - January 23, 2009 - 15:10

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

 
 

Drupal is a registered trademark of Dries Buytaert.