Comments

Coupon Code Swap’s picture

+1 subscribe

alberto56’s picture

Subscribing, thanks.

kehan’s picture

subscribing

idflood’s picture

Status: Needs review » Needs work

I got a notice with the patch for some fields I'm trying to prepopulate ( but it's still working ).

Notice: Undefined index: #type in _prepopulate_request_walk() (line 62 of .../sites/all/modules/prepopulate/prepopulate.module).

If I remove the check '&& $form[$requestvar]['#type'] != "value"' there is no more notice and fields are still prepopulated. But I'm sure it's not the right thing to do.

idflood’s picture

Status: Needs work » Needs review
StatusFileSize
new1.75 KB

I'm not sure it's the perfect solution but I made a little change to the verification. In this patch I use:
isset($form[$requestvar]['#type']) ? $form[$requestvar]['#type'] != "value" : TRUE

I've also removed the files[] from the .info since they are no longer required if there is no class or interface registered in them.

dennys’s picture

I just apply patch #5 in Drupal 7.0 and it's ok.

kehan’s picture

Subscribing

roam2345’s picture

Subscribing

danny_joris’s picture

subscribing

idflood’s picture

StatusFileSize
new1.12 KB

Here is a reroll of the last patch. I had to change the logic a bit.
from: if (!is_null($form['#default_value']))
to: if (isset($form['#default_value']) ? !is_null($form['#default_value']) : FALSE)

Seems to be working but needs some testing

roam2345’s picture

Been using the previous patch here http://www.bayetecakes.co.za , clicking on the register link uses it. Rather simple case but will check out this new patch soon, with some testing my side.

webankit’s picture

The pacth could not be applied since there is a new dev version and moreover the function has been updated ...

idflood’s picture

StatusFileSize
new1.13 KB

Here is a reroll of the last patch...

unleet’s picture

subscribing

sergiofg’s picture

subscribing

mthomas’s picture

subscribing

aethiolas’s picture

subscribing

marcoka’s picture

subscribe

ropaolle’s picture

Subscribe

bryancasler’s picture

Patch in #13 seems to work against the git version

Mel55113’s picture

Subscribe

cwightrun’s picture

Subscribing!

xandeadx’s picture

Subscribing

Encarte’s picture

subscribing

idflood’s picture

patch still apply correctly. if you want to test it:

git clone --branch 6.x-1.x http://git.drupal.org/project/prepopulate.git
cd prepopulate
wget http://drupal.org/files/issues/prepopulate_d7_port-935990-13.patch
git apply prepopulate_d7_port-935990-13.patch
rm prepopulate_d7_port-935990-13.patch

tebb’s picture

Title: Port to drupal7 » Prepopulate: Port to drupal7

Can this be released for D7 now/soon?

idflood’s picture

The patch needs to be tested/reviewed before it get committed I think. I contacted a committer to see I he can do something with it.

Trunkhorn’s picture

sub

lightstring’s picture

Subscribing

giorgio79’s picture

It has been six months since dereine and idflood posted this patch, perhaps we can consider this module abandoned, and idflood could apply for maintainership if interested?
Here is how to
http://drupal.org/node/251466

idflood’s picture

#30: good idea, I've finally asked to be a maintainer. So if this goes well, you will see as soon as possible a 7.x-2.x-dev version available.

CatherineOmega’s picture

#31: Looking forward to it!

jbrauer’s picture

This module is not abandoned and a port to a D7 version will be made available as soon as it can be. Apologies for the lack of details but there are some things that need to be updated before we're ready for a D7 version (which is why a branch isn't yet open in git).

videographics’s picture

Thx for the update. Waiting patiently...

Trunkhorn’s picture

A core update is holding this up?

drasgardian’s picture

I followed the instructions in #25, but then if I add something like this to the end of my url
/node/add/agenda?edit[title]=blah

it does pre-populate the title field, but also shows an error
Notice: Undefined index: title in prepopulate_form_alter() (line 29 of .............../prepopulate.module

boobaa’s picture

Subscribing. (Internal ref. #949)

KirstenLangholz’s picture

And for the young and inncocent ;)))) - could sombody please make a dev shot with the patches attached for easier install and testing?

Thank you sooooo much!

eliza411’s picture

Status: Needs review » Needs work

Subscribing. Thanks for your work on this!

alberto56’s picture

Status: Needs work » Needs review

@eliza411 please specify why you changed this to needs work. Meanwhile I have set it back to needs review.

Cheers,

Albert

eliza411’s picture

Didn't meant to do that. Thanks for setting it back.

bjalford’s picture

Status: Needs review » Reviewed & tested by the community

#25 worked for me. I'd suggest rolling out a D7 version using patch in #25 then close this ticket and raised separate tickets for any bugs.

matt2000’s picture

RTBC+1. Patch is working great here.

jbrauer’s picture

Status: Reviewed & tested by the community » Needs work

I've branched for Drupal 7 but the patch here is against an older insecure branch SA-CONTRIB-2010-086 - Prepopulate - Access Bypass. Please do not use this patch against the 6.x-1.x branch on any production sites as it would be vulnerable to known security issues. I'll look at rolling a patch this weekend if nobody beats me to it.

alexbk66-’s picture

Version: » 6.x-2.x-dev

+1

P.S. I had to pick a 6.x version as there's no 7. But I wonder how everybody else managed to add comments?

Cheek’s picture

Following..

mike503’s picture

Subscribing

David D’s picture

Subscribble

artatac’s picture

sub

andrew7’s picture

+1

a.siebel’s picture

subscribe

artatac’s picture

StatusFileSize
new252.42 KB

If it helps.. we have been working to get this working on D7, but have had to adapt it to work correctly with dates. and the working alteration is below and as an attached forked module (as it now may not work with non date fields). I hope that this helps others until the real d7 version is available. Of greater minds than mine polish the attached up!

function _prepopulate_date_get_walk( & $form, & $getslice) {
  if (is_array($getslice)) {
    if (isset($form['#default_value']) ? !is_null($form['#default_value']) : FALSE) {
       if (!is_array($form['#default_value'])) {
         // Something went wrong so stop here.
         return;
      }
      $form['#default_value']['value'] = $getslice['value']['date'];
    }
    else {
      foreach (array_keys($getslice) as $getvar) {
        if (element_child($getvar) && is_array($form) && !is_null($form[$getvar])) {
          _prepopulate_date_get_walk($form[$getvar], $getslice[$getvar]);
	 
	  
        }
      }
    }
    
  }
  else {
    $form['#default_value'] = $getslice;
    
  }
}
geek-merlin’s picture

sub

mgifford’s picture

Good to see this coming along.

joekotvas’s picture

Subscribing. Can anyone point me toward some documentation on how to use patches? I'd like to try those posted here, but I'm not sure where to start.

artatac’s picture

eliza411’s picture

It's probably worth noting that those directions reference using -p0 and since the Git migration, there's been a transition to using -p1 ... I'm not sure how fully complete the transition is, but if -p0 fails, trying -p1 is worth a shot.

joekotvas’s picture

Thanks!

jbrauer’s picture

Note that the patches here will leave your site insecure. Contributions to patches based on the 6.x-2.x branch with security issues fixed welcome.

likewhoa’s picture

the 7.x branch is not compatible with current -dev drupal

TimelessDomain’s picture

subscribing

xlyz’s picture

subscribing

xlyz’s picture

Status: Needs work » Needs review
StatusFileSize
new4.27 KB

Here attached a tarball with a port to 7.x based on latest 6.x-2.x-dev code.

Code is available in a sandboxed project as well:

git clone --branch master http://git.drupal.org/sandbox/xlyz/1195320.git prepopulate
TimelessDomain’s picture

Status: Needs review » Reviewed & tested by the community

SWEET! It works

Title - http://www.example.com/node/add/blog?edit[title]=this is the title
Body (field in D7) -  http://example.com/node/add/page?edit[body][und][0][value]=this is the body
Taxonomy Term Reference Field - http://example.com/node/add/page?edit[field_tags][und]=here are some tags, and more tags

(These are harder - for ex. I couldn't figure out checkboxes & radio buttons, but i got the free-tagging widget to work

I have not tested other fields yet but it would seem that #63 is in fully working order. THANKS. We should add these D7 specific examples to the documentation. Please post others as you find them. If you can figure out how to populate checkboxes as well, please let us know.

Cheek’s picture

Awesome, this is gonna save me a lot of time copy & pasting. Thanks guys!

BTW, fields work as well: "&edit[field_fieldname][und][0][value]=fieldtext"

Fidelix’s picture

Subscribing... Gonna need this for a future project ^^

mstrelan’s picture

subscribe

jbrauer’s picture

Status: Reviewed & tested by the community » Fixed

Thanks. Committed to 7.x branch without a lot of additional testing. I'll get a -dev release out in the next cycle so we start to get more testing.

Status: Fixed » Closed (fixed)

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

Kman2123’s picture

Is there a reason this is not in full release yet?

Kman2123’s picture

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

Status: Active » Fixed

@Kman2123 maintainer decides if it should be tagged as a major release, as he stated a -dev release is out. Give it time and I am sure he/she will tag a major release.

Status: Fixed » Closed (fixed)

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

Kman2123’s picture

Status: Closed (fixed) » Active

@jbrauer Thanks for taking a look at this!

likewhoa’s picture

Status: Active » Closed (fixed)

this should be closed @Kman2123, why did you reopen it?

Kman2123’s picture

Status: Closed (fixed) » Active

I requested @jbrauer to look at it and see if it can be moved from dev to full so technically it's not fixed.

jbrauer’s picture

Status: Active » Closed (fixed)

The port is done and in a development branch but there are bugs to fix prior to a release being made.