?
avatar infograf768
infograf768
28 Jan 2019

Steps to reproduce the issue

Display Contacts Manager or select a contact and use batch

Expected result

The Option No User is proposed when editing a contact or in the batch modal.

Actual result

PHP Notice: Undefined variable: noUser in /layouts/joomla/html/batch/user.php on line 26

I tried to modify both in
/administrator/components/com_contact/tmpl/contacts/default_batch_body.php
and
/administrator/components/com_contact/tmpl/contacts/default_batch.php
the line
<?php echo LayoutHelper::render('joomla.html.batch.user', []); ?>
to
<?php echo LayoutHelper::render('joomla.html.batch.user', ['noUser => $noUser]); ?>
without success.

Then I found out that
<?php echo LayoutHelper::render('joomla.html.batch.user', []); ?>

is only used for contacts.

Therefore I modified //layouts/joomla/html/batch/user.php and commented out $noUser
to

//if ($noUser)
//{
	$optionNo = '<option value="0">' . Text::_('JLIB_HTML_BATCH_USER_NOUSER') . '</option>';
//}
?>
<label id="batch-user-lbl" for="batch-user" class="modalTooltip" title="<?php
echo HTMLHelper::_('tooltipText', 'JLIB_HTML_BATCH_USER_LABEL', 'JLIB_HTML_BATCH_USER_LABEL_DESC'); ?>">
	<?php echo Text::_('JLIB_HTML_BATCH_USER_LABEL'); ?>
</label>
<select name="batch[user_id]" class="custom-select" id="batch-user-id">
	<option value=""><?php echo Text::_('JLIB_HTML_BATCH_USER_NOCHANGE'); ?></option>
	<?php echo $optionNo; ?>
	<?php echo HTMLHelper::_('select.options', HTMLHelper::_('user.userlist'), 'value', 'text'); ?>
</select>

This solves the issue, but this layout could be used by a 3pd who would not want the "No User" option and therefore would need to override the layout.

Any idea what should really be done?

avatar infograf768 infograf768 - open - 28 Jan 2019
avatar joomla-cms-bot joomla-cms-bot - change - 28 Jan 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 28 Jan 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 3 Mar 2019
Status New Discussion
avatar franz-wohlkoenig franz-wohlkoenig - change - 28 Mar 2019
Category com_contact
avatar franz-wohlkoenig franz-wohlkoenig - change - 1 Apr 2019
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2019-04-01 07:33:02
Closed_By franz-wohlkoenig
avatar joomla-cms-bot joomla-cms-bot - change - 1 Apr 2019
Closed_Date 2019-04-01 07:33:02 2019-04-01 07:33:03
Closed_By franz-wohlkoenig joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 1 Apr 2019
avatar joomla-cms-bot
joomla-cms-bot - comment - 1 Apr 2019
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 1 Apr 2019

Closed as Issue resolved somewhere. @infograf768 please reopen if Issue isn't resolved.

avatar infograf768
infograf768 - comment - 1 Apr 2019

The nouser display issue was solved here:
#24228

Add a Comment

Login with GitHub to post a comment