jDownloads Support Forum

jDownloads for Joomla 4.x and 5.x => jDownloads 4.0 => Bugs! => Topic started by: michpaule on 08.04.2023 12:31:35

Title: Custom fields visible only in tabbed view? - [Fixed in 4.0.25]
Post by: michpaule on 08.04.2023 12:31:35
Excerpt from edit.php:
<!-- CustomFields TAB -->             
         
         <?php 
         
if ($rules->uploads_use_tabs) { 
                   
             if (
ComponentHelper::isEnabled('com_fields') && $params->get('custom_fields_enable') == 1){
                 
$this->ignore_fieldsets = array('general''info''detail''jmetadata''item_associations');
                 echo 
LayoutHelper::render('joomla.edit.params'$this);
             }
             
         } 
?>

No else path given ==> custom fields not rendered in non-tabs case.
Bug or feature?
Best regards

Michael
Title: Re: Custom fields visible only in tabbed view?
Post by: ColinM on 09.04.2023 14:49:23
Hi,
Could you please advise where you found the code fragment
Thanks
Colin
Title: Re: Custom fields visible only in tabbed view?
Post by: michpaule on 09.04.2023 14:57:13
Line 628 in edit.php.
Path in .ZIP: \com_jdownloads\site\tmpl\form\edit.php
Path on server: /components/com_jdownloads/tmpl/form/edit.php

Title: Re: Custom fields visible only in tabbed view?
Post by: ColinM on 09.04.2023 16:25:23
Hi
These  Custom Fields were used in jDownloads 3.2 but when updating to jD3.9 they were converted to  regular Joomla Custom Fields.
So I think the code you found is perhaps a 'leftover' and is not required any more.

No doubt Arno will clarify/confirm.

Colin
PS see article https://www.jdownloads.net/documentation/general-items-v3-9/fields-in-jdownloads
Title: Re: Custom fields visible only in tabbed view?
Post by: Arno on 10.04.2023 00:41:16
Quote from: michpaule on 09.04.2023 14:57:13
Line 628 in edit.php.
Path in .ZIP: \com_jdownloads\site\tmpl\form\edit.php
Path on server: /components/com_jdownloads/tmpl/form/edit.php
Seems to be a bug. I will check this in detail.
Title: Re: Custom fields visible only in tabbed view?
Post by: michpaule on 10.04.2023 07:22:24
Thanks Arno and Colin,
currently I'm using the following workaround:
         <?php 
         
if ($rules->uploads_use_tabs) { 
                   
             if (
ComponentHelper::isEnabled('com_fields') && $params->get('custom_fields_enable') == 1){
                 
$this->ignore_fieldsets = array('general''info''detail''jmetadata''item_associations');
                 echo 
LayoutHelper::render('joomla.edit.params'$this);
             }
             
         } else {
             
// Use customized layout (see $basepath)
             
if (ComponentHelper::isEnabled('com_fields') && $params->get('custom_fields_enable') == 1){
                 
$this->ignore_fieldsets = array('general''info''detail''jmetadata''item_associations');
                 echo 
LayoutHelper::render('edit.params'$this$basePath);
             }
 } ?>


I copied params.php from /layouts/joomla/edit to /administrator/com_jdownloads/layouts/edit and modified it there.
Just removed the tabs stuff and replaced fieldsets with divs.
For me the result is perfectly fine.
But there might be better (official) ways.
Best regards

Michael
Title: Re: Custom fields visible only in tabbed view?
Post by: Arno on 10.04.2023 09:39:50
Okay. Seems to be correct for your case.  ;)
Title: Re: Custom fields visible only in tabbed view?
Post by: ColinM on 10.04.2023 15:05:21
In 'front end' Options - 'Use tabs in the Download details view' I had set to Tabs.
Seems to work AOK. 
Did not test for adding any custom tabs
Colin
Title: Re: Custom fields visible only in tabbed view?
Post by: Arno on 11.04.2023 16:55:31
Hi Colin,
yes it works with activated tabs option, but only in this case! This was also described in the old options description:

COM_JDOWNLOADS_USERGROUPS_UPLOAD_USE_TABS_DESC="Shows Upload details in a tabbed form or as a sequential List. A sequential list is useful if the user is only being asked for a few details. Default is Yes. Note: if you wish to edit Fields or Field Groups from the frontend then this option must be set to Yes."

This is now changed to:

COM_JDOWNLOADS_USERGROUPS_UPLOAD_USE_TABS_DESC="Shows Download fields in a tabbed form or as a sequential List. A sequential list is useful if the user is only being asked for a few details. Default is Yes. Note: Self-created fields or field groups are always displayed within a tab."

And in the attached file changed the script to get this (now correct) output. See pics with and without enabled 'tabs' option.
Will be a part from next 4.0.25 release (together with the changed language files).
Title: Re: Custom fields visible only in tabbed view? - [Fixed in 4.0.25]
Post by: ColinM on 12.04.2023 10:52:53
Arno
Thanks for the explanation but I am a little confused!!
Presently COM_JDOWNLOADS_BACKEND_SET_USE_TABS_DESC reads as below.

COM_JDOWNLOADS_BACKEND_SET_USE_TABS_DESC="If set to sliders or tabs then three additional fields are shown below allowing you to optionally specify the label of up to three additional sliders or tabs. When the tabs option is set to Yes then special placeholder variables may be used in your details layout to view tab content. The layout of a tab may be changed in the jdownloads_fe.css file. See also details about layouts and read the FAQ."

Also as in another case perhaps the above should refer to jdownloads_custom.css rather than jdownloads_fe.css

Colin
Title: Re: Custom fields visible only in tabbed view? - [Fixed in 4.0.25]
Post by: Arno on 12.04.2023 21:17:42
Should I have mixed something up?  ::)
I'll check again at my leisure.
Title: Re: Custom fields visible only in tabbed view? - [Fixed in 4.0.25]
Post by: Arno on 12.04.2023 21:44:09
Please see pics.   
This are two different things.
Input and output.
Title: Re: Custom fields visible only in tabbed view? - [Fixed in 4.0.25]
Post by: ColinM on 12.04.2023 23:22:53
Arno,
In User Groups setting 'Use Tabs in Frontend Upload Form' the DESC is
"Shows Upload details in a tabbed form or as a sequential List. A sequential list is useful if the user is only being asked for a few details. Default is Yes. Note: if you wish to edit Fields or Field Groups from the frontend then this option must be set to Yes."

Think the part about being needed for editting in frontend should be retained.
Adding
"Note: Self-created fields or field groups are always displayed within a tab."
would also be useful

Colin
Title: Re: Custom fields visible only in tabbed view? - [Fixed in 4.0.25]
Post by: Arno on 13.04.2023 09:43:08
Quote from: ColinM on 12.04.2023 23:22:53
Arno,
In User Groups setting 'Use Tabs in Frontend Upload Form' the DESC is
"Shows Upload details in a tabbed form or as a sequential List. A sequential list is useful if the user is only being asked for a few details. Default is Yes. Note: if you wish to edit Fields or Field Groups from the frontend then this option must be set to Yes."

Think the part about being needed for editting in frontend should be retained.
Adding
"Note: Self-created fields or field groups are always displayed within a tab."
would also be useful

Colin

I don't understand your problems with my (small) changes (see pic). Your quotes are from an older version, my text from 4.0.25. Or is it not correct English?