Custom fields are not populated with template data

Search
Other Bug Reports questions
Forum

Custom fields are not populated with template data

Rikard J's Avatar Rikard J
Hi
I have trouble getting my content templates to set custom fields. I have tried three different types of custom fields (list, radio and text) but neither is populated when I apply the template. I have checked both "Override content" and "Override settings". I don't know which one of them that is supposed to control the custom fields.

I have my custom field in two different custom fields groups, I have tried to remove the fields from the groups, but that did not change anything, the fields were still not populated.

Can this be a bug, or am I just missing some important setting somewhere?

Best regards

-------
Joomla 4.2.3
Content Templater 11.0.0
PHP 8.1.11
Peter van Westen's Avatar Peter van Westen ADMIN
Please try the latest development version from:
regularlabs.com/development-releases
Please post a rating at the Joomla! Extensions Directory
Rikard J's Avatar Rikard J
Thank you Peter
I have tested the dev version, but I get the following error message when I try to click the "content template" button:

----
An error has occurred.
0 Class "\RegularLabs\Plugin\EditorButton\ContentTemplater\Popup" not found
----

I tested the buttons for conditional content and snippets, and they still work. (in case this is relevant information)

Best regards,
Rikard
Peter van Westen's Avatar Peter van Westen ADMIN
Yup... fixing it now...
Please post a rating at the Joomla! Extensions Directory
Peter van Westen's Avatar Peter van Westen ADMIN
Should be fixed now.
Please post a rating at the Joomla! Extensions Directory
Rikard J's Avatar Rikard J
Thank you Peter
I have tested the new version and the button works again. I have also tested the custom fields functionality, and I still have trouble, even though it is better than before. I'll describe my findings.

I have tested:
Textarea (Works perfectly)
Url (Works perfectly)
Radio (Problematic)
Checkboxes (Problematic)
List (Problematic)

Textarea and URL works without problem, but the other types don't work directly. I can force them to work though. I'll explain.

-If I create a new article and apply the template. Then textareas and urls are updated. But not the other types.
-If I save the article, close it and open it again., It is still the same. textareas and urls are populated, not the other fields.
-If I now apply thetemplate again, to the already saved article, then list, checkboxes and radio fields are updated as well.

I have tested on multiple articles. If the article have been saved first, then all fields are populated, but if the article is new, and haven't been saved, then only url and textarea works (among the types that I have tested)

Best regards,
Rikard
Peter van Westen's Avatar Peter van Westen ADMIN
Weird. I cannot reproduce this behaviour. All custom fields are working fine for me.

Can you give me (super) admin and (s)ftp access so I can take a look?
And tell me on what url I can see/reproduce the issue.
You can use the 'Confidential information' button in the forum editor to hide sensitive information.
Please post a rating at the Joomla! Extensions Directory
Rikard J's Avatar Rikard J
Hi Peter, I found out what is going wrong.

The problem lies in that my custom field are not available for all content categories. And it seems that the template tries to set the custom fields before the category is set. And this leads to custom fields not being set. If I apply the template twice, then the custom fields are populated.

How to reproduce
- Create a content category "mycategory"
- Create a custom field for example textarea "mycustom_field"
- Set "mycustom_field" to be available only for "mycategory"
- Create a content template - "mytemplate"
-- Set the category of the template to "mycategory"
-- Set the value of the custom field "mycustom_field" to "my custom data"
--set the template to override Settings and Content
- Create a new article and apply the template "mytemplate"

Now when you look at the article, the customfield "mycustom_field" is empty, if you apply "mytemplate" again, it will be populated with "my custom data".

Best regards,
Rikard
Peter van Westen's Avatar Peter van Westen ADMIN
Please try the latest development version from:
regularlabs.com/development-releases
Please post a rating at the Joomla! Extensions Directory
Rikard J's Avatar Rikard J
Thank you Peter, I've tested it at it works perfectly.

Excellent support for excellent extensions, as always. Keep up the good work,
Rikard
Peter van Westen's Avatar Peter van Westen ADMIN
Thanks, and happy it works now 🙂
The fix will be included in the next release.
Please post a rating at the Joomla! Extensions Directory
You can only post on this forum if you log in