News:

Dear forum visitors, if the support forum is not available, please try again a few minutes later. Thanks!

Main Menu
Support-Forum

Custom fields not loaded ($item->jcfields) - [Fixed in 4.0.25]

Started by michpaule, 13.04.2023 11:30:26

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

michpaule

Problem:
{jdfield_title ID} and {jdfield ID} always empty.

Tested on:
jDownloads Versions 3.9.8.7 and 4.0.24

See related report:
https://www.jdownloads.com/forum/index.php?topic=12898.0

Observation:
jcfields array always empty.
Example:
            // Insert the Joomla Fields data when used
            if (isset($items[$i]->jcfields) && count((array)$items[$i]->jcfields)){


Workaround:
Patch function getItems() in /components/com_jdownloads/src/Model/DownloadModel.php (or downloads.php for 3.9)
            // Get the tags
            $item->tags = new TagsHelper;
            $item->tags->getItemTags('com_jdownloads.download', $item->id);

            // Populate jcfields
            $item->jcfields = FieldsHelper::getFields('com_jdownloads.download', $item, true);
           
            // Build the multilingual association hints
            if ($item->params->get('show_associations')){
                $item->associations = AssociationHelper::displayAssociations($item->id);
            }           


@Arno: Could it really be the case that this problem has been in the code for so long?
Or did I miss something?

Best regards

Michael
  •  

Arno

Hi,
thanks for this bug report.

I have no idea why I had always overlooked this before. Sorry.
It's fixed now in jD 4.
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •