Needs work
Project:
Prepopulate
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
28 Apr 2008 at 06:07 UTC
Updated:
25 Apr 2018 at 04:06 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jbrauer commentedComment #2
jbrauer commentedEr... Not quite sure why the last patch seemed to work at some point... because it clearly doesn't really work. So here's version 2 of the patch.
Comment #3
ff1 commentedThis sounds like a great feature and one the I may like to use. I've not installed the prepopulate module yet, so can you give me a run-down of how this feature works. E.g. What options are available? Can an admin determine which prepopulated fields will be hidden? etc...
Thanks
Ian
Comment #4
jbrauer commentedIt doesn't allow an admin to work on a field-by-field setting... that would have to be added as more GET arguments. It allows the administrator to say on a content type basis whether the prepopulated fields should be hidden on the form.
Comment #5
add1sun commentedThis is a bit different now in 6.x-2.x (HEAD code) where we have removed the node type checkbox and prepopulate now works on all forms. I'm sorta thinking I'd rather have a settings page that lists content types and lets you select which ones will be hidden rather than spreading them out to each content type page.
Also we need to make it clear that this can only be set on content types (not any other kind of form.) We could also just have a "master" toggle that either hides or shows all of your prepopulated fields on all forms on the site.Giving folks both options (global or by content type) or some variation(s) of that needs to be determined and make sure we come up with a clear UI for selection.
I'm going to move this to v2 and needs work due to this.
Comment #6
NoRandom commentedHi
Sorry, I'm new to patch files but I can't make it work.
After patching de module I don't see any diference. I'm not sure but maybe is my fault patching, if I look into the patched module I still see "// $Id: prepopulate.module,v 1.5.2.1 2008/03/12 16:40:38 add1sun Exp $" at the top.
I've tried patching the module manually and it neither works.
One example link is: http://pixelgordo.com/node/add/juego?edit[taxonomy][3]=53 wich works but I can still view the taxonomy 3 selection menu.
Please, tell me if you need more information. If someone submit the module already patched I'll receive it very glad, thanks ;)
Comment #7
jbrauer commented@Macarro The CVS identifier isn't changed by the patch.
After patching the files there should be a new option along with the "allow pre-populate" to mark the content type to be "hide on prepopulate". I haven't gotten back to it to move this forward with regard to the changes Addi suggests for D6 and beyond.
Comment #8
NoRandom commentedYes, I see it now and it's checked but it doesn't work.
Comment #9
NoRandom commentedA bit of extra information:
I've just unchecked both options, allow prepopulate and hide prepopulated fields, and saved the options.
Then, I've rechecked them and everything seems to work, prepopulated fields are hidden. But when I try to post the new node I get an error message:
If you need more information, don't hesitate to ask for it. Kind regards.
Comment #10
dwwSeeing comment #5 in this thread makes me think this is the right place to discuss my request, but if this really belongs in a separate issue, just let me know...
We'd love to have prepopulate on d.o for the issue node form, so that for example, api.drupal.org could have links on every page to "Report a bug in this documentation" that went to something like:
However, chx is worried about making all d.o forms prepopulate-able. So, it'd be nice to just have a way to lock down which forms get the behavior. We could always hack the copy we deploy on d.o, but it'd be nicer if the module supported that upstream. @add1sun: are you down with that? Is this the issue for that? If not, where should we discuss/implement this?
Thanks!
-Derek
Comment #11
add1sun commentedHm, well it used to do just that, where you could enable it per content type, and then it was removed since it didn't seem horribly useful (and non content-type forms didn't work at all since there was no config to enable it). :-p Is there a specific concern about which forms should *not* be prepopulatable? I don't have a problem adding a feature for this but a UI for non-content type stuff would need to be sorted out. This should probably be a new feature request since that is different from just hiding prepopulated fields from users.
Also note that I have not been actively maintaining this module for a while (and seems like none of the other co-maintainers are either) so if someone wants to take this over and make it into what D.o needs, let me know.
Comment #12
jbrauer commentedHaving recently worked with similar settings on other modules it seems that there is a good case for having the ability to control which forms pre-populate from both the content type page as well as a centralized list for the whole module. Will be working on a patch for this in the next couple of weeks if one isn't here sooner. My current thinking is
Options 2 & 3 will allow an additional setting to allow hiding pre-populated fields if the administrator so desires.
Comment #13
themselves commentedI'm very interested in seeing this in action, it seems to be an obvious feature to me, in as much as I'd suggest it's almost more common to want to hide the field than not. For now I can hide it with CSS, but that's not an ideal situation. Perhaps we could look at being able to hide this on a role basis, as in regular users don't get to change it, but a full admin can.
Comment #14
xcorex commentedI'm very interested in seeing this in action[2].
Subsc...
Comment #15
aschiwi commentedI see you're going in a different direction here with applying a patch and all but in case somebody is interested - I use the formfilter module to hide prepopulated fields and it works fine for almost all fields (have had some problems with organic group selection fields back in drupal 5, not sure if that works now).
Comment #16
Flying Drupalist commentedsubscribe
Comment #17
drummWhat were the specifc concerns about prefilling any form on drupal.org?
Comment #18
drummchx's concern:
17:05 < chx> drumm: this borders CSRF
17:05 < chx> drumm: I would like to exclude admin forms
17:05 < chx> drumm: of course it is not CSRF in itself, but... it makes me
uneasy
17:06 < chx> drumm: you are lowering the barrier where a barrier is a good
thing.
17:06 < drumm> chx: it is just pre-fill, not pre-submit
17:07 < chx> drumm: so let's say someone wants to get added to the Drupal
Planet, and he provides a comfy link which prefills the feed add
form. That makes TOO easy for an admin to make two clicks and dont
think.
17:07 < chx> drumm: exclude this from admin/* and I am happy
17:08 < drumm> chx: I would hope our admins are smart enough so that won't be a
problem
17:08 < chx> drumm: i find your faith amusing
17:08 < chx> drumm: actually we mayhaps actually want to *whitelist* this to
node/add/project-issue
chx's quick solution, disable the module from drupalorg module: http://drupalbin.com/10335
Comment #19
drummMy review:
Yes, the drupalorg_init() solution is a quick hack, but it gets the job done. It is better than nothing and allows #500536: File an issue for this link to move forward.
I also support doing nothing and letting any form be pre-filled. I see the point of the concern, but think it is too hypothetical to spend time on. If it is a problem once deployed for all forms, then it is worth spending time on. Meanwhile, the prepopulate module can implement a clean solution at its own pace.
Comment #20
killes@www.drop.org commentedHeine is not happy with this and this neither am I. The risk that somebody crafts crafty links and some admin being in a hurry is just too high.
Comment #21
killes@www.drop.org commented20:33 < Heine> [20:22] I'd custom fill a few whitelisted elements from $_GET
20:33 < Heine> [20:23] eg, status, project & title
Comment #22
drummThis issue should return to whatever was going on before comment #10, the drupalorg module can do a minimal whitelist for now. It is always good to remove things like this from the drupalorg module, we can move to prepopulate when it can whitelist on a form/field basis.
Comment #23
drummThe drupalorg module issue is #512824: Prepopulate project issue metadata from $_GET.
Comment #24
christefano commentedIs anyone still working on this now that this issue is back on its original course?
I was sure that Prepopulate was configurable per content type and I'm glad my memory isn't failing. Thanks for the clarification, add1sun!
Comment #25
kompressaur commentedFor now I can hide it with CSS, but that's not an ideal situation.
#13 how would one go about doing that themselves/anyone? thanks. Ive looked at formfilter aschiwi but it isnt doing the jobe. content taxonomy seems overload too. a quick css fix will do for me. thanks.
I suppose i should at least suggest a way to hide it so as i can improve my css/drupal knowledge. ok so i open up firebug in firefox and look at the field.....i look above and see it is in a div id 'edit-taxonomy-tags-1-wrapper' which is in a div class standard and then a div class node-form. Nope i have no idea what to do. maybe....
Was i even close?
tx
Comment #26
Louis Bob commentedThe module works great, it prepopulates my field as needed.
Only issue is that when the field is hidden, the field value won't be passed through on form submit.
=> Is there a way to have it working for hidden fields?
=> What is the status of this issue?
Comment #27
fehin commentedMay 2013, I have the same concerns as Louis Bob.
Comment #28
technikh commentedhttp://drupal.org/project/entityreference_prepopulate does similar thing for fields of type entityreference
It provides an option to hide the field on the Action dropdown. http://drupal.org/files/images/er-populate.jpg
"Action to take when prepopulating field with values via URL"
Comment #29
spineless commentedIn my use case. I allowing general users the ability to create a product from a button on a page. I want to pre-populate a number of hidden fields so that the product can be listed on a different page. So using PHP linked to the button image I want to add the field data to the URL string and have these hidden fields populated.
I have attempted other ways to sort and filter the products I need including entity reference prepopulate but using prepopulate appears to be the only way I can add date to specific nodes that also allows me to isolating the users and the user projects on the site.
I need a way of pre-populating the field and not allowing the user to see what these fields contain. Hiding the field is available but when I do the content from the URL string does not get loaded into the field.
Did someone come up with a solution to this issue?
Comment #30
jbrauer commentedRe #29 The patch in #2 is a start at this (albeit for an earlier version of the module. The key concern is you would want to be able to make sure that users couldn't see the URL and decide to alter some other field that you didn't intend ... i.e. the "revenue sharing" or "published" or "author" fields perhaps even though you didn't include them on the form.
There isn't at present an out-of-the-box means of doing this that I'm aware of.
Comment #31
spineless commentedIs there a reason why the patch in #2 was not added to the dev version? That patch is 5 years old so I assume it would have been included in the module by now.
What does the patch do exactly? Does it allow the fields to be hidden or does it attempt to hide the data included in the URL?
How can I use the patch on the current version of this module?
Comment #32
vulfox commentedAny news on this?
Comment #33
pianomansam commentedEdit: Apparently, this approach causes the field values to not be saved. So please ignore while I try to figure out a different solution.
Here's a code snippet using hook_field_access() to hide pre-populated fields. The entityreference_prepopulate module uses the same technique. Please note that it doesn't provide any settings. It simply hides all prepopulated fields.
Comment #34
nithinkolekar commentedThis will be good for registration codes , coupon codes etc. There must be some admin configuration form to enable/disable entity wise which includes taxonomy and user objects too.
Comment #35
behanner commentedThis works in drupal 7 if you use Display suite to hide the fields. And I suspect the same method works in Drupal 8
So I would recommend closing.