solved Aparna module with audio or uploaded files that are marked required

MAD
MAD
@madc
10 years ago
600 posts
Found an issue with the Aparna module.

If you upload ( For Example )
an audio file ( in my case the area is called "upload podcast" )
that is marked as Required in the form designer everything works great.

But if you go back in and try to edit any field in that form and try and save it, it keeps throwing the error
"You have entered an invalid value for "upload podcast"

If I upload another file in that form field it saves fine. ( which is wrong only did it to test )
BUT
If I go into form designer and uncheck that field as required every edit works perfectly.

Bug?


--
~ https://punkbandpromotions.com ~
Check us out for all your Punk/Alternative Music!
Check us out on Facebook:- https://facebook.com/PunkBandPromotion

updated by @madc: 03/03/14 01:46:39PM
paul
@paul
10 years ago
4,326 posts
If I'm understanding this correctly, you added a file upload field with required set to both the create and update forms, but then found you had to uncheck the required in the update form for it to work ok?
That sounds right to me.
If the update form file upload field is required, you are going to have to upload a new file every time.


--
Paul Asher - JR Developer and System Import Specialist
MAD
MAD
@madc
10 years ago
600 posts
Ok Thanks @paul. I thought if you already had a file uploaded the requirement was already fulfilled.
Seems strange to have to upload the same file for just a slight typo edit in another field.


--
~ https://punkbandpromotions.com ~
Check us out for all your Punk/Alternative Music!
Check us out on Facebook:- https://facebook.com/PunkBandPromotion
brian
@brian
10 years ago
10,148 posts
ba9801:
Ok Thanks @paul. I thought if you already had a file uploaded the requirement was already fulfilled.
Seems strange to have to upload the same file for just a slight typo edit in another field.

Yes - the "required" flag means that the field is required - for a file upload this means a file must be uploaded on that form or it will get an error.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
MAD
MAD
@madc
10 years ago
600 posts
Is there any way of letting the module know that if a file is already there, to then allow the edits in other fields instead of having to upload the file again?


--
~ https://punkbandpromotions.com ~
Check us out for all your Punk/Alternative Music!
Check us out on Facebook:- https://facebook.com/PunkBandPromotion

updated by @madc: 01/30/14 06:47:38PM
SteveX
SteveX
@ultrajam
10 years ago
2,584 posts
If you require the file upload in the create form and don't require it in the update form that should give you something close to what you want. The file can't be deleted in the update form, but it can be replaced with a new file. Or is it that you wnat the file to not be changeable after the initial upload?


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
MAD
MAD
@madc
10 years ago
600 posts
Well @SteveX the only thing i am trying to get my head around is
that if a user is simply trying to edit a form in other fields of that form
then they must upload another or the same file again for it to complete???

That doesn't sound right to me.
Yes the field was required on the initial creation
but upon edit it should already know that there is a file there and the requirement was/is already fulfilled.

So why should that be required again?
It doesn't make sense.

First time YES
if EDITING why upload another or the same file again when that area has a file already and has sorted the required section on the first upload?

Sorry if I am being pedantic but I have never seen any other software I have used require another upload in a required field if it has already been met.


--
~ https://punkbandpromotions.com ~
Check us out for all your Punk/Alternative Music!
Check us out on Facebook:- https://facebook.com/PunkBandPromotion
paul
@paul
10 years ago
4,326 posts
Sorry - I'm not getting what the issue is here.
I've just created an aparna module.
I then added a file field to its create form with required set to on.
I then added the same file field to its update form with required set to off.
I created an item with an uploaded file.
I then updated that item without re-uploading the file.
Is this how you have it set up, and its not working?
Pa


--
Paul Asher - JR Developer and System Import Specialist
MAD
MAD
@madc
10 years ago
600 posts
Why do you have to add it again on edit? (update)
The users can't set the required to off so every time you need to edit something in the form
Lets say
Image Upload = image
Song Upload = Song
Text area or editor = blah blah blah

If I need to go back into the form and update it ( or a user ) they get the error as they haven't uploaded a new file?
The file is already there and has met the required field element as it was done before
why do it again?

Here if i don't upload another file ( all up to date btw ) it throws the error saying there is a problem with my upload field
"You have entered an invalid value for "upload podcast"

Even if i just edit a little bit of text on the form and try and save it I get that error
If I do the edit and upload another file it works fine....
But why do I have to upload another/same file again?
As I said it doesn't make sense...

So what you are saying is I should edit through the form designer and remove the tick in add to update form?



--
~ https://punkbandpromotions.com ~
Check us out for all your Punk/Alternative Music!
Check us out on Facebook:- https://facebook.com/PunkBandPromotion

updated by @madc: 01/31/14 08:28:26AM
paul
@paul
10 years ago
4,326 posts
Are we talking about the same thing here?
I'm talking about creating and setting up the file field using the Form Designer, as Admin.
Users don't get a say in which fields are required or not.
Sorry - I'm pretty confused with what you are saying :-(


--
Paul Asher - JR Developer and System Import Specialist
SteveX
SteveX
@ultrajam
10 years ago
2,584 posts
It is because you are requiring an upload in the update form.

If you require in the create form, and then NOT require in the update form that will give you exactly what you are looking for.

The require isn't a requirement for the file to exist, it's a requirement for an upload in the current form.


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
MAD
MAD
@madc
10 years ago
600 posts
paul:
If I'm understanding this correctly, you added a file upload field with required set to both the create and update forms
Ok In the Aparna module that I have created there is no area to set the required or untick the update forms.
I think that is the issue
As you can see below
There is no checkbox for the add to update



--
~ https://punkbandpromotions.com ~
Check us out for all your Punk/Alternative Music!
Check us out on Facebook:- https://facebook.com/PunkBandPromotion

updated by @madc: 01/31/14 08:52:23AM
SteveX
SteveX
@ultrajam
10 years ago
2,584 posts
If you click the Form Designer button on a create form you edit the create fields, and click it on an update form to edit the update fields.

Create and update are separate forms in the form designer.


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
MAD
MAD
@madc
10 years ago
600 posts
ok I don't see that
So I need to re-create my field as it's only in the new field area?
edit: hmmm in the Aparna module the only option I have is ADD TO CREATE FORM
Yet in the jrAudio module I have ADD TO UPDATE FORM

prob21.jpg
prob21.jpg  •  81KB




--
~ https://punkbandpromotions.com ~
Check us out for all your Punk/Alternative Music!
Check us out on Facebook:- https://facebook.com/PunkBandPromotion

updated by @madc: 01/31/14 09:11:52AM
SteveX
SteveX
@ultrajam
10 years ago
2,584 posts
Quote: edit: hmmm in the Aparna module the only option I have is ADD TO CREATE FORM
Then you are looking at the update form. On the create form it will say "add to update form"

From your screenshot, click the Form Designer button, you will be on the Create form page. You should be able to jump between the forms using the select menu top right.

Switch to the Update form, then click the Modify button for the "audio file" field. At the bottom uncheck Required and save.
create-update.png
create-update.png  •  18KB




--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)

updated by @ultrajam: 01/31/14 09:12:26AM
MAD
MAD
@madc
10 years ago
600 posts
Ok done thanks @SteveX.
So does that mean I need to do that field again or can I edit it??
I can see the problem now. It defaults to the opposite of the norm.
It defaults to the update page instead of the create
Unlike the other modules which default to the create

It was in the loud-fast-shitty-radio/update section
That is what was/is confusing and yes in the update section I have the upload set to required.
Not used to that as it normally opens the create rather then the update section


--
~ https://punkbandpromotions.com ~
Check us out for all your Punk/Alternative Music!
Check us out on Facebook:- https://facebook.com/PunkBandPromotion

updated by @madc: 01/31/14 09:18:28AM
SteveX
SteveX
@ultrajam
10 years ago
2,584 posts
Quote: It defaults to the update page instead of the create
That could be some problem with modules made with aparna then, I don't know, I haven't used it.

Apart from registering the forms as designerable a module doesn't have much to do.
If you have something similar to these lines in your module's init function in include.php everything is handed over to the core, even the adding of the form designer buttons.
   jrCore_register_module_feature('jrCore','designer_form','myModule','create');
jrCore_register_module_feature('jrCore','designer_form','myModule','update');

Form designer works as a magic view for each module: /mymodule/form_designer. The designer forms and fields, editing them, storing and retrieving from the db, are all managed by the core as well.


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
SteveX
SteveX
@ultrajam
10 years ago
2,584 posts
You should be able to edit the field.


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
MAD
MAD
@madc
10 years ago
600 posts
As I am new to JR I didn't actually realise there was a separate update form accessible from the dropdown in form designer.
Thanks for explaining it to me @SteveX. Something so simple yet I missed it completely.
Feel really stupid now :)
Cheers everyone for the support!

ps. Just tried editing a blog post to test the required on update and create ( Blog Text Required both set to yes in update and create )
I could save that without having to add or edit the blog text field. So just a question, Why did it save ok yet the audio field that was set to required on both forms in my Module require another upload?
Not a biggy now as I know I can set Required to no.
I take it, it is because it's a file?
brian:
for a file upload this means a file must be uploaded on that form or it will get an error.



--
~ https://punkbandpromotions.com ~
Check us out for all your Punk/Alternative Music!
Check us out on Facebook:- https://facebook.com/PunkBandPromotion

updated by @madc: 01/31/14 06:59:00PM
michael
@michael
10 years ago
7,717 posts
You could set it to 'no' on the update form, but 'yes' on create.

So it is required during the create process, but not required on the update.
updated by @michael: 01/31/14 10:17:08PM
MAD
MAD
@madc
10 years ago
600 posts
Yep thank @michael. Thats what I did. As I said it was a stupid mistake on my behalf


--
~ https://punkbandpromotions.com ~
Check us out for all your Punk/Alternative Music!
Check us out on Facebook:- https://facebook.com/PunkBandPromotion
michael
@michael
10 years ago
7,717 posts
Not what i meant. What I meant is the Form Designer fields are able to let you do it however you want to do it.

You can set it up so that on the update page, you CAN force the user to re-upload the file if you want to.

So its a choice.

The default of when you set the create to 'required' is to duplicate that on the update

That will cause the situation you had:

"The user is required to upload a file during create AND upload a file during update."
To get the situation (which really make more sense for 90% of the cases) where the user can update the title or the body without re-uploading the file you would change the update Field Designer to 'Not Required' while still leaving the create set to required.

Not a stupid mistake, just different ways of configuring the system.

Tags