Page 1 of 1

display_form parameter not implemented in Classic form style / obsolete show_form check / form style toggle stuck on Cla

Posted: 10 Aug 2026, 13:21
by vmf
Hello Jan,

Running Joomla 5 with the Cassiopeia template, updated to the latest version of Phoca Guestbook. Found the following issues, all related to the guestbook entry form:

1. default_form_classic.php checks a parameter that no longer exists

The file starts with:

if ($this->params->get('show_form') == 1) :

But show_form is not present anywhere in the menu item params or in the global component options JSON (checked directly in the database). Since params->get('show_form') returns null without a fallback default, this condition is always false, and the entire form block (including the toggle button and the form itself) never renders.

2. The "Display form" option (display_form) is not implemented in the Classic form template

The Options screen has a toggle: "Display form directly or output a link that opens the form on click" (display_form). I could not find any reference to display_form in default_form_classic.php — so for Classic style users, this setting appears to have no effect regardless of its value.

I have not tested whether the non-classic form template (default_form.php) is affected by the same display_form issue — I noticed the same absence of the parameter there when reviewing the code, but haven't confirmed it live on a site, so please treat that part as unconfirmed.

3. "Form style" toggle (Classic / non-Classic) doesn't seem to take effect

I also tried switching the "Form style" option in the component Options away from Classic, but the frontend kept rendering the Classic template regardless of the saved setting. This happened both on the previous version I was using before updating, and on the current one — so it doesn't seem to be new in this release, and I'm not sure whether it's a bug or intentional behaviour I'm missing.

4. Possible effect of "Load Bootstrap" option unclear

The "Load Bootstrap" option is set to "No" on my site. I could not get the Classic form's show/hide toggle to work using Bootstrap's data-bs-toggle="collapse" markup (no JS errors in the browser console, button visible but non-functional), so I ended up implementing a plain JavaScript toggle instead as a workaround. I haven't determined for certain whether this was caused by the "Load Bootstrap" setting, a Cassiopeia-specific Bootstrap loading issue, or something else — just flagging it in case it's relevant.

Steps to reproduce (issues 1–2, Classic style):

Set form style to Classic
Set "Display form" option to "Hide" (button instead of form)
Result: no button, no form, nothing is rendered on the frontend

Below are the changes I made in a template override for default_form_classic.php to work around issues 1, 2 and 4:

Code: Select all

// BEFORE (start of file, after the "use" statements):
if ($this->params->get('show_form') == 1) :
	$displayForm = ((string) $this->params->get('display_form', '1') === '1');
?>
	... (form block, unchanged)
<?php
endif; //showForm
?>

// AFTER:
$displayForm = ((string) $this->params->get('display_form', '1') === '1');
?>
<?php if (!$displayForm) : ?>
	<p>
		<button type="button" class="btn btn-primary pgb-btn-primary" onclick="pgbToggleForm()">
			<?php echo Text::_('COM_PHOCAGUESTBOOK_POST_MESSAGE'); ?>
		</button>
	</p>
<?php endif; ?>
<div id="pgb-form-wrapper" style="<?php echo $displayForm ? '' : 'display:none;'; ?>">
	... (form block, unchanged)
</div>
<script>
function pgbToggleForm() {
	var el = document.getElementById('pgb-form-wrapper');
	el.style.display = (el.style.display === 'none' || el.style.display === '') ? 'block' : 'none';
}
</script>
Thanks for maintaining this extension!