No Code Attached Yet
avatar petrovicivan
petrovicivan
5 Jan 2020

Steps to reproduce the issue

I created Custom fields in Mail form and they showed up after Captcha field and before Send button

Expected result

Captcha should be last field in form before Send button

Actual result

System information (as much as possible)

Additional comments

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
5.00

avatar petrovicivan petrovicivan - open - 5 Jan 2020
avatar joomla-cms-bot joomla-cms-bot - labeled - 5 Jan 2020
avatar petrovicivan petrovicivan - change - 5 Jan 2020
The description was changed
avatar petrovicivan petrovicivan - edited - 5 Jan 2020
avatar alikon alikon - change - 5 Jan 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-01-05 09:40:14
Closed_By alikon
avatar alikon alikon - close - 5 Jan 2020
avatar petrovicivan
petrovicivan - comment - 5 Jan 2020

It seems that we can't override, I have tried chaneging order of fields in tempaltes/mytemplate/html/com_contact/contact/default_form.php

`<?php
/**

  • @Package Joomla.Site
  • @subpackage com_contact
  • @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
  • @license GNU General Public License version 2 or later; see LICENSE.txt
    */

defined('_JEXEC') or die;

JHtml::('behavior.keepalive');
JHtml::
('behavior.formvalidator');

?>

form->getFieldsets() as $fieldset) : ?>
		<?php $fields = $this->form->getFieldset($fieldset->name); ?>
		<?php if (count($fields)) : ?>
			<fieldset>
				<?php if (isset($fieldset->label) && ($legend = trim(JText::_($fieldset->label))) !== '') : ?>
					<legend><?php echo $legend; ?></legend>
				<?php endif; ?>
				<?php foreach ($fields as $field) : ?>
					<?php echo $field->renderField(); ?>
				<?php endforeach; ?>
			</fieldset>
		<?php endif; ?>

		<?php if ($fieldset->name === 'captcha' && !$this->captchaEnabled) : ?>
			<?php continue; ?>
		<?php endif; ?>

	<?php endforeach; ?>
	<div class="control-group">
		<div class="controls">
			<button class="btn btn-primary validate" type="submit"><?php echo JText::_('COM_CONTACT_CONTACT_SEND'); ?></button>
			<input type="hidden" name="option" value="com_contact" />
			<input type="hidden" name="task" value="contact.submit" />
			<input type="hidden" name="return" value="<?php echo $this->return_page; ?>" />
			<input type="hidden" name="id" value="<?php echo $this->contact->slug; ?>" />
			<?php echo JHtml::_('form.token'); ?>
		</div>
	</div>
</form>
`
avatar petrovicivan
petrovicivan - comment - 5 Jan 2020

Her is suggested that only way to archive this is hardcode custom field in override template
Your text to link here...


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27407.

avatar alikon
alikon - comment - 5 Jan 2020

yes, maybe not the most easy/clean override, but the way to go

avatar petrovicivan
petrovicivan - comment - 5 Jan 2020

There is a problem with multilingual sites, you have to create 2 overrides

avatar SharkyKZ
SharkyKZ - comment - 6 Jan 2020

You can use this override to move captcha to bottom https://gist.github.com/SharkyKZ/592cc44c68eac9b3ef7e0b3abb2699f3.

avatar svermassen
svermassen - comment - 16 Jun 2022

If the function like now exists in Joomla! 4 for adding custom fields, it's should not be an override, but should be fixed in the Core of Joomla.

avatar pepperstreet
pepperstreet - comment - 30 Jun 2022

Absolutely agree with @svermassen @petrovicivan
This is a layout and UX bug.

@alikon
Please, re-open this issue.
Any chance to get a solution into J!4.2 ?

Thanks in advance.

avatar obuisard obuisard - change - 17 Aug 2022
Status Closed New
Closed_Date 2020-01-05 09:40:14
Closed_By alikon
Labels Added: No Code Attached Yet
Removed: ?
avatar obuisard obuisard - reopen - 17 Aug 2022
avatar obuisard
obuisard - comment - 17 Aug 2022

This is definitely an issue that should be addressed.
There are easy ways to fix this. @SharkyKZ would you like to write a PR for it?
Note that I think the modifications should be done before the fields are loaded in the template file.

avatar brianteeman
brianteeman - comment - 26 Aug 2022

please test #38607 the code was there it was just wrong

avatar richard67 richard67 - close - 26 Aug 2022
avatar richard67
richard67 - comment - 26 Aug 2022

Closing as having a pull request. Please test #38607 . Thanks in advance.

avatar richard67 richard67 - change - 26 Aug 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-08-26 10:08:29
Closed_By richard67
avatar svermassen
svermassen - comment - 26 Aug 2022

Nice work !!!

avatar brianteeman
brianteeman - comment - 26 Aug 2022

its only nice if it is accepted and for that it needs people to test it

avatar svermassen
svermassen - comment - 26 Aug 2022

For me it works.
But it's a YooTheme-site.
So I had to copy part of the code (changes) in the file from the template self.
So it's not the repro as it should be for the testing :-(

avatar obuisard
obuisard - comment - 26 Aug 2022

@petrovicivan can you take a look at #38607 and test the patch? Thank you!

Add a Comment

Login with GitHub to post a comment