Hi,
This site is for consultants, they review CV's if approved, approve and account that sends an email to the user that he is approved and he can use the site username and password.
To do this, content profile is the best module to use.
the following steps were done
1. Content type resume created, enabled as content profile
2. Filefield and appear in user registration enabled and REQUIRED option selected
everything is fine, some users are registering with CV's and some forget to CLICK ON UPLOAD. and gets registered without a prompt from system that they have forgot to press UPLOAD.
Please help me we are losing customers, i know nothing more than enabling and disabling.
Thanks
Danish
Comment | File | Size | Author |
---|---|---|---|
#42 | content_profile_registration.module.patch | 703 bytes | jrstmartin |
#30 | content_profile_registration_filefield_required.patch | 1.58 KB | scalp |
#14 | content_profile_registration-451654.patch | 928 bytes | Jon Pugh |
#13 | custom_filefield.txt | 3.62 KB | albert24 |
#12 | custom_filefield.txt | 3.75 KB | albert24 |
Comments
Comment #1
chrism2671 CreditAttribution: chrism2671 commentedI can confirm this behaviour on beta 4.
I performed the test by clicking save on the node without clicking the upload button. The expected behaviour is to upload on node save without having to explicitly click on the upload button.
I have tested this using
It is worth noting that this worked correctly under Drupal 5.
It is unclear whether this is being caused by content profile, CCK, filefield or node.
Any thoughts (or requests for further info) very much appreciated!
Danish- Did you resolve this issue?
Comment #2
macrodesign CreditAttribution: macrodesign commentedsee Chrism,
I changed the workflow. using logintoboggan module. now users are login as soon as they create the account and directed to create resume page, on this page they create their resume and upload 1-2 files as required and it is working fine. But i failed to do it on 1 page i.e registration + resume.
Comment #3
vivianspencer CreditAttribution: vivianspencer commentedI can also confirm this bug, if you don't press the upload button during registration the file wont upload
Comment #4
chrism2671 CreditAttribution: chrism2671 commentedI had a developer look at it for a morning and he says that this is because the form handler on the user form is different from the form handler on the CCK form. He says that the one for the user/nodeprofile is much simpler, and while it can handle all the basic CCK widgets, it doesn't handle the filefield properly.
Can anyone make sense of this?
C.
Comment #5
quicksketchMarked #519726: FileField and Content Profile and #529768: Filefield doesn't work properly on nodeprofile as duplicates. This is a bug with Content Profile (or maybe an unwritten "feature") and not with FileField, since FileField is meant to work with CCK and Content Profile uses a bit of a hack to the user registration form since CCK wasn't actually meant to provide this sort of functionality.
Comment #6
fagoI never had a look at it or tried it.
From the README:
* Putting file uploads on the registration form is not supported and probably won't work right.
Comment #7
chrism2671 CreditAttribution: chrism2671 commentedIs it something we could look at? Do you think it might be hard to resolve? I don't mind taking some time to look at it, if I had some pointers in the right direction.
Comment #8
fagoProbably just something is missing form $form that filefield needs.
Comment #9
chrism2671 CreditAttribution: chrism2671 commentedI would be willing to sponsor $50 for the fix of this problem.
Comment #10
pecker CreditAttribution: pecker commentedI thought I was doing something wrong when I couldn't get this to work.
I don't know if I'm relieved or frustrated that it's not a simple fix.
+1 for getting this as a feature.
Comment #11
chrism2671 CreditAttribution: chrism2671 commentedI'm going to increase my bounty to $70 if fixed in the next 2 weeks. It would be very much appreciated!
Comment #12
albert24 CreditAttribution: albert24 commentedHi chrism2671!
I think I have come up with a fix for this problem. Well, it's technically more of a "hack" than a fix.
You're right when you said...
So I decided to just approach this problem in a very straightforward manner.
Since you really just want to prevent users from submitting the form without first hitting the upload button, then I decided to address it by auto-uploading the selected file right after the user selects a file.
I added some jquery code to handle this. I added it directly to the filefield.js file inside the filefield module directory.
What I did...
I added the following code. (Please refer to attached file to find out where I inserted the following code).
What this does...
1. I added some jquery code to auto-press the upload button when the user selects a valid file. I got the idea from this post.
2. I added another piece of code to disable the submit button while it is uploading. This is to prevent the user from prematurely submitting the form when the file hasn't been successfully uploaded yet.
More code...
What this does...
It's a function that checks every 1 second if the upload widget has already been replaced with a preview widget (which means that it's done uploading), and if yes, enable the main submit button so that the user can submit the form.
There are some anticipated side-effects to this hack. One is that this will affect all filefield upload widgets of your entire site. They will all have the auto-upload functionality. This shouldn't be a problem, since it's actually what you really expect it to do, right?
Another side-effect is that this will only work on the current module version (filefield-6.x-3.1). And it might not work properly (or might not even work at all) on future upgrades of the module, since this is a hack. But this shouldn't be a problem if you are content with how filefield currently performs. You can just wait until filefield makes the feature you want built-in, and then you can make the upgrade.
It works in IE 7, Opera, Firefox, and Chrome.
I used filefield-6.x-3.1.
Directions:
1. Replace the filefield.js file in your filefield module directory with the attached file (Make sure that you rename the file to filefield.js).
That's it.
Should you have any questions or clarifications, don't hesitate to let me know. Thanks! Enjoy!
If you are satisfied with the quick fix, my paypal email is albertpadin(at)gmail(dot)com. The bounty will be greatly appreciated!
Comment #13
albert24 CreditAttribution: albert24 commentedHi chrism2671!
I made a change in the checkIfUploaded() function. The change will make the hack work even in image file uploads using the filefield widget. I uploaded the modified custom_filefield.txt (please refer to attachment).
PLEASE USE THE CURRENT ATTACHMENT. You can disregard the previous one. Thank you!
I hope this has helped. Enjoy!
Comment #14
Jon PughThe problem is this, thanks to firebug:
"Form contains a file input, but is missing method=POST and enctype=multipart/form-data on the form. The file will not be sent."
Attached is a patch that detects if the enctype is set in a node form, then sets it in the user registration $form.
Comment #15
fagoah yep, of course the enctype has to be set. I've committed that fix, thanks.
I set the issue to fixed for now. I don't know if filefield works now, it might - feel free to reopen if it doesn't. Anyway I'm happy to add in (proper) fixes for that, but it's still "officially" not supported.
Comment #17
sabyrodrigues CreditAttribution: sabyrodrigues commentedComment #18
sabyrodrigues CreditAttribution: sabyrodrigues commentedHi,
The hack provided at http://drupal.org/node/451654#comment-2029388 was really effective if people forget to click the upload button as it auto uploads the Browsed content.
I am using Content profile to expose fields at Registration which has a compulsory Upload Resume Field with an red (*) marking it as compulsory Field in Registration display.
Unlike other Compulsory fields if left empty displays a warning message that the field is required . this ain't working with the File Field Compulsory Upload Button Field exposed in registration.
Users Can Skip this field and Complete the registrations. I am too loosing out on Resumes due to this problem. Can Anybody having knowledge with the validation During registration check for the same.
Regards
Comment #19
iaminawe CreditAttribution: iaminawe commentedI replaced the js file and applied the patch.
This no longer seems to work with Filefield 6.x-3 and Content Profile 6.x-1.0-beta4
I have two required image filefields on my registration form and if I leave them empty, I can still submit the form without any validation warning.
If I choose browse and then dont choose upload and save the form, the images are not added or uploaded
If I choose browse and then upload for each and I submit the form they are still not attached
Any help with this would be greatly appreciated.
Thanks
Gregg
Comment #20
iaminawe CreditAttribution: iaminawe commentedSorry i was wrong, it does work to upload the images but it does not respect the fact that the upload fields are required and so allows users to register without attaching any images.
Comment #21
bneel CreditAttribution: bneel commentedI have the same problem with Filefield 6.x-3 and Content Profile 6.x-1.0-beta4.
Thanks
Ben
Comment #22
TwoDI encountered the same problem on a client's site and found that it happens because content_profile_registration module ignores the form-level #validate callbacks set on each node form. ImageField and FileField won't run their filefield_node_form_validate() callback because of this.
As a fix I added the below code to content_profile_registration.module
in content_profile_registration_add_profile_form() around line 160.
That is just after merging in the fields from the content type.
So far I've not seen any side effects of this, but it's only been tested with a single content type adding file/image fields to the registration page.
I would have thought adding the #submit handlers would be required as well (I know at least upload module uses one), but it wasn't needed in our case.
If people find this useful (and it's not just plain wrong to do it this way) I'd be happy to provide a proper patch, but I'm new to these modules so I've probably missed something.
EDIT: Fixed typo in PHP tag causing it to be filtered out.
Comment #23
MattClark CreditAttribution: MattClark commentedHi TwoD,
I am also facing the same problem. Your solution sounds promising, but I couldn't find the code you mentioned anywhere.. could you please post your suggested fix again?
Regards,
Comment #24
nedwardss CreditAttribution: nedwardss commentedThis worked well for me. TwoD's code is added in the content_profile/modules/content_profile_registration.module file as was said, around line 160. I put it after
$form += $form_add;
and beforeif (!isset($form['#content_profile_weights'])) {
I haven't experienced any side effects either, but until there is a patch applied, this seems to work for me.
Thanks TwoD!
Comment #25
fagoAs filefields are not supported on the registration page (see README) turning priority down to normal.
Comment #26
JThan CreditAttribution: JThan commentedThe filefield validates now, but says the file is needed even when it was uploaded.
Before: You could save the profile without uploading a file
After: You cannot save the profile even if you include a file
EDIT: Fixed Typo
Comment #27
JThan CreditAttribution: JThan commentedI followed this and found
filefield_node_form_validate($form, &$form_state)
in filefield_widget.inc (Filefield 3.7). I had to change that function to make this working. I added a ticket there to ask if my changes do any harm (I bet they will): http://drupal.org/node/917642So, this is working for me now, but more tests will be done this week. If I dont report back, everything went fine :)
EDIT: To be clear: I got this working with both TwoD's Code and my hack of filefield module.
Comment #28
jannol CreditAttribution: jannol commentedI use content profile 6.x-1.0
I added the code above and it works fine without anything else. Thx
Comment #29
YK85 CreditAttribution: YK85 commentedA patch has been uploaded at #623548: Imagefield not required when set to be
Comment #30
scalp CreditAttribution: scalp commentedI added this patch to another issue, but it was suggested that I add it here too. This will cause filefields to be truly required on registration if they're set to be. It works well for me, hopefully others will find it useful.
Comment #31
seakayjay CreditAttribution: seakayjay commented#30 patch works fine with me. It is indeed pretty useful. Thank you,scalp.
Comment #32
obrienmd CreditAttribution: obrienmd commented#30 patch works great here as well.
Comment #33
fagoRe-categorizing due to #25.
Comment #34
grahamvalue CreditAttribution: grahamvalue commentedFrom http://drupal.org/node/836332#comment-3744388
Here's a sample solution in the meantime that works (modify for files accordingly)
function hook_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL)
{
if($node->type == 'profile')
{
if ($node->field_profpic[0]['filesize'] == 0)
form_set_error('field_profpic', t('Please upload a profile picture.'));
}
}
Comment #35
kirankumar_k CreditAttribution: kirankumar_k commentedHi All,
How can i add a file upload field in registration form to upload user his photo or resume, can anybody please help me in this issue asap...
Thanks inadvance...
----Kira............
Comment #36
guntherdevisch CreditAttribution: guntherdevisch commentedHi all,
Looks nice, but i'm having problems showing the filefield on my registration form. I'm using AAR for 2 roles; each has a separate registration path (using "Assign from Path"). That's working fine, but i also have a content profile field (filefield) that's activated in my content profile settings ("Use on Auto Assign Role paths") for one of my registration pages. The problem is that i'm not seeing my content profile field in my registration form.
Can someone help me?
-> FIXED <- I had to enable the module "Content Profile User Registration"
I'm also using LoginToboggan.
Thanks for your time,
Gunther
Comment #37
kirankumar_k CreditAttribution: kirankumar_k commentedHi all,
I want to display user profile image in all pages in menu block and i am using 'zeropoint' theme, but am unable to do that. Can any body please help in this issue asap.
Thanks inadvance,
---Kira________
Comment #38
aleada CreditAttribution: aleada commentedReply to #30
why this patch is not applied on the latest release of content_profile module?
What will be happen on the next releases? We should apply the patch again and again?
Comment #39
guntherdevisch CreditAttribution: guntherdevisch commentedI don't know if it is allready mentioned, but an important note for #30 is that you must apply the patch, before you install the module :) I'm also curious if this patch will be applied on the next release.
Great patch, thanks!
Greets,
Gunther
Comment #40
scalp CreditAttribution: scalp commentedI'm glad to hear that the patch is working for people. I don't know anything about getting it committed though. Does anyone know if there's something I need to do to get it committed or do the maintainers just pick up patches from the issues and commit them?
Comment #41
scalp CreditAttribution: scalp commentedComment #42
jrstmartin CreditAttribution: jrstmartin commentedThe suggested code in #22 works against 6.x-1.x-dev for me. I'm not using it for Filefield though. I'm using it for a free tagging Taxonomy with the Taxonomy Limit module applied, so users can't inundate the site with bunk tags.
The issue was that Taxonomy Limit module wasn't allowed to add its #validate function callback. It works now. Fully tested. No issues like those mentioned in #26. Thanks TwoD!
Attached patch for convenience.