DUPLICATE: PHP Code output in the frontend is only outputted for logged in users who are allowed to execute code in the backend. Bug?

Hi!

I just found that a php code element outputting this html code:

<div><a class="brxe-button btn--white bricks-button bricks-background-primary" href="https://xxx/xyz.pdf.pdf" target="_blank">Download</a></div

only output the code in the frontend for logged in users, and only for those logged in users which are allowed in the Bricks settings to execute code in the backend. For anonymous users and users who are not allowed to execute code, no html code at all is outputted in the frontend.

The PHP code is:

<?php
// Getting the value:
$value = rwmb_meta( 'pr_download_url' );
if (!empty ($value)) {
	echo '<div><a class="brxe-button btn--white bricks-button bricks-background-primary" href="'.$value.'" target="_blank">Download</a></div>';  
}
?>

It has worked before, but I don’t know when it stopped working. A longshot: Does it have anything to do with the upgrade to 1.9.6.1? What else could it be? There are no conditions set for the element.

More info: the code block element is inside a query loop. I have a sister site with the same settings and a similar code block inside a query loop, and there it seems to work - for the moment I can’t see what is different …

Very similar to my bug report: WAIT: Code element inside query loop doesn't work in the frontend for logged in users who are not admins

@Sridhar has confirmed that it is a bug! WAIT: Code element inside query loop doesn't work in the frontend for logged in users who are not admins - #8 by Sridhar

Closing this post as its a duplicate of WAIT: Code element inside query loop doesn't work in the frontend for logged in users who are not admins

We’ve got a fix. For more details, please view the original post. Thank you.

1 Like