• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Placeholders don't work in Eval Populate for checkbox?

Status
Not open for further replies.

usdc-or

Member
If I put quote marks around my placeholders e.g. '{tablename___elementname}' then the eval is seeing {tablename___elementname}, rather than the value of that element. If I don't use quote marks, an error is returned because of the curly bracket.

I'm using some of these values in the query to get the checkbox options. Any advice would be appreciated.
 
Thank you; I did just see it works fine on existing data, and so was clued into the issue. A bit odd that it returned the placeholder rather than a null value, but I was able to work around it.
 
That's actually an option in the function that does the replacement. So it's always a judgement call as to which option is best in any given scenario, whether to keep the placeholders or remove them if they aren't found. In general, I tend to err towards leaving them, as it often makes it more obvious what the problem is, when you see a placeholder where you don't expect it, rather than an empty string (which could mean lots of things).

In this case, I think it's probably better to remove them. It's just never come up before - very few people use that feature, and even fewer us placeholders in it. In fact, you are the first person I can recall raising the issue.

So ... I'll go and change the code to strip them ...

-- hugh
 
Oh, BTW, did you know you can use defaults in placeholders, with a || seperator?

So {tablename___elementname||1} will default to 1 if the placeholder isn't found.

-- hugh
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top