[SOLVED] Fabrik content plugin - elements not working

thellie

Member
Hi all,
My site is coming along leaps and bounds... most issues are being resolved by chatting to Betsy (my nickname for ChatGPT), and I'm learning loads. It also means I'm not hassling you lot as much as I otherwise would :p

Still, it's nice to ask questions, and it hopefully helps others with the same/similar problems.

Today's issue - {fabrik view=element list=19 rowid=[rowid] element=vol_appform___id}

The list ID is correct, I expect the [rowid] is still the same syntax, and the element is definitely existing, published, in the list, and spelled correctly...

I also checked that it's in the 'Show in list' option in the Fabrik List menu item.

I inserted the code to get a list (works correctly), and a form (works correctly)...
All this is in the intro area of a fabrik group with the form.

so why am I getting this error:

0 You are trying to embed an element called vol_appform___name which is not present in the list or has been unpublished
 
Last edited:
Can you try:
In components\com_fabrik\models\element.php change line 8165 to

return $this->getElement()->published === 1;

Added for the next release.
 
Last edited:
In related business ( :rolleyes: ) the content generated is the first row only. I currently have 2 test records, but entering either record shows the data for the first record.
{fabrik view=element list=19 rowid=[rowid] element=vol_appform___name}
 
I can't replicate.
Do you have a URL parameter rowid?
What happens if you hardcode your rowid?
{fabrik view=element list=19 rowid=your-2nd-id element=vol_appform___name}

Make sure to have no unprintable characters inside {} (i.e. depending on your editor switch to code view etc.).
 
Hard coded rowid works (I tried 26 and 27, both gave the correct information). Nothing inside the code other than what should be there. I've already updated line 8165, and rechecked it.

Screen Shot 2566-07-03 at 17.55.09.png


Element code with [rowid] does not work properly - I get the rowid of the first row only (rowid=26), not matter who I'm logged in as - superuser, rowid=30, or another rowid

On saving the article I get an error:

500 Layout default not found

The article saves and the error occurs only when the element code is in the text. Pulling in a list or a form are working properly.

See below for further screenshots...

The first two are the text in the article. The third image shows the error message
text in article - editor view.png
text in article - code view.png
Error on saving article.png


Below is the article (reached via a single article menulink) The rows 26-30 are hard-coded and don't show at all. The final row is [rowid] and shows rowid=26's name
Article frontend | Rows 26-30 hardcoded rowid.png

list 19 - backend | AppID is the primary ID.png


Below - I inserted the code into the form intro text area using [rowid] - backend only the name is showing correctly, and frontend (logged in as rowid=30 it's showing the data for rowid=26
Form 19 | AppID 30 backend.png
Form 19 | AppID 30 frontend.png
 
On saving the article I get an error:

500 Layout default not found
Replicatable. But only if you "Save", it's ok with "Save + Close". It's coming from com_content, it seems the layout=edit needed for editing gets lost (resp. not set again after Fabrik changed it). But the article is saved correctly.

For the rest:
Did you enable in form settings
upload_2023-7-3_13-55-30.png
 
Yes, all correct in the settings - I think if not correct the list and form views wouldn't have worked would they?
 
I think if not correct the list and form views wouldn't have worked would they?
No. An article always processes J!plugins, Fabrik forms and details views only if they are set to.
So you must enable this setting in the form where you put the content plugin into the intro.
 
What are you doing exactly where?
As I said I can't replicate, it's working fine on my site
 
I'm setting up an article as a template to create a certificate for volunteers to print out/save a pdf , instead of us using paper.
I actually wanted to use the article form plugin, as that's the way I did it before. But as it's not ready I thought I would try it this way instead.

It's like the rowid isn't being picked up - in the wiki notes it says
  • 'If no rowid is specified then the first row is loaded (3.1 since 16/09/2013)'
Is my logic wrong? Am I trying to do something that's not possible? I've been working 16-18 hour days for about 3-4 weeks now on this new version, so I'm probably not thinking that clearly...
 
I grabbed a couple of hours sleep, and come back to look at it again.

I have put the code in the form=19 intro text area
Screen Shot 2566-07-04 at 03.54.06.png

Then checked what data it is pulling in the backend and frontend.

In the backend ___name is correct, but ___id is blank
Screen Shot 2566-07-04 at 04.07.36.png

In the frontend, it's completely wrong
Screen Shot 2566-07-04 at 03.58.08.png
I wondered why it wasn't showing the rwoid=26 now, and realised it's the list sort. For the above screenshot list sort was on ___first_name asc
Screen Shot 2566-07-04 at 04.15.09.png

So I changed it to:
Screen Shot 2566-07-04 at 03.59.47.png
and the resulting data changes to match the list sort order
Screen Shot 2566-07-04 at 04.00.01.png
I'm not completely wrong, am I? It should be showing the data from rowid=30 each time, not the data from the first row in the sort order...?
 

Attachments

  • Screen Shot 2566-07-04 at 03.58.35.png
    Screen Shot 2566-07-04 at 03.58.35.png
    246.8 KB · Views: 52
  • Screen Shot 2566-07-04 at 03.57.55.png
    Screen Shot 2566-07-04 at 03.57.55.png
    246.2 KB · Views: 53
In principle: the elements you want to show mustn't be hidden (the id element is).
This is why ___id is not showing in the backend.

Frontend:
Obviously it's really doing 'If no rowid is specified then the first row is loaded (3.1 since 16/09/2013)' in the frontend (no idea why this was done) and it's working different in this case (showing hidden elements).
I can't see any rowid in the URL of your frontend screenshot (it's showing only ...form/19).
But even with a rowid (like form/19/30): It seems to need explicitly the rowid=xy parameter so it's not working with SEF URLs.

How do you call your form?
In a custom link you can add the rowid parameter (or any other one like e.g. myrow={rowid} and then use rowid=[myrow] in the content plugin).
 
Thanks for your patience. I'll look at this over the course of today, amongst my other jobs, and send an update later.
 
Okay, so quicker than I expected. I resaved the internalid element (vol_appform___id) as a field, and the hidden option was on. So I turned it off, resaved as an internalid, then checked the element's configuration in PHPMyAdmin to confirm that the hidden option was 0.

Once that was completed, I created a new user (deleting all the old ones and truncating the relevant tables), and the whole thing seems to be working correctly now. Hopefully that's an end to it... and again, thanks for your help and patience :)

Screen Shot 2566-07-04 at 07.04.13.png
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top