J3 Issue ?
avatar infograf768
infograf768
5 Sep 2018

Steps to reproduce the issue

Unhappily, PR #21695 was merged

Now, one has to click on search tools to define for which language site or admin to make the override.
It will always default to the alpha order of the language (and site) if not selected through searchTools when creating a new override.

We have to find a better solution imho.

I mean we may still use searchtools to filter (although we need a solution to display all overrides as the new field does not provide a possible empty Option), but we need a specific field separated from SearchTools to select to which language and client we want to create a new override for.

Instead of

screen shot 2018-09-05 at 06 38 45

and then click to get

screen shot 2018-09-05 at 06 38 28

We need at least something like

screen shot 2018-09-04 at 18 05 20

and possibly modify the override edit form to choose there the language/client.

This is not so easy to do.
To obtain the screenshot above, I moved the language_client field out of the filter fields as we do usually (plus added an option), and added a new layout where bar.php is customised.

so I did for filter_overrides.xml

<?xml version="1.0" encoding="utf-8"?>
<form>
	<field
		name="language_client"
		type="languageclient"
		filtermode="selector"
		onchange="this.form.submit();"
		>
			<option value="">COM_LANGUAGES_OVERRIDE_SELECT_LANGUAGE</option>
	</field>

	<fields name="filter">
		<field
			name="search"
			type="text"
			label="JSEARCH_FILTER"
			description="COM_LANGUAGES_SEARCH_IN_TITLE"
			hint="JSEARCH_FILTER"
		/>

	</fields>
	<fields name="list">
		<field
			name="limit"
			type="limitbox"
			label="JGLOBAL_LIMIT"
			description="JGLOBAL_LIMIT"
			class="input-mini"
			default="25"
			onchange="this.form.submit();"
		/>
	</fields>
</form>

and for the specific bar.php layout

defined('JPATH_BASE') or die;

$data = $displayData;

if ($data['view'] instanceof LanguagesViewOverrides)
{
	// We will get the language_client filter & remove it from the form filters
	$langClient = $data['view']->filterForm->getField('language_client'); ?>
	<div class="js-stools-field-filter js-stools-language_client">
		<?php echo $langClient->input; ?>
	</div>
<?php
}
// Display the main joomla layout
echo JLayoutHelper::render('joomla.searchtools.default.bar', $data, null, array('component' => 'none')); ?>

I also had to modify for the sake of the demo, i.e. to display the Select:

		// Add the languages to the internal cache.
		$this->cache = array_merge(parent::getOptions(), $languages);

in the new languageclient new field type

It does not work, i.e. the select box sticks its value to the first language in alpha order and site client.

@wilsonge

avatar infograf768 infograf768 - open - 5 Sep 2018
avatar joomla-cms-bot joomla-cms-bot - change - 5 Sep 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 5 Sep 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 5 Sep 2018
Status New Discussion
avatar franz-wohlkoenig franz-wohlkoenig - change - 5 Sep 2018
Category com_languages
avatar infograf768 infograf768 - change - 5 Sep 2018
The description was changed
avatar infograf768 infograf768 - edited - 5 Sep 2018
avatar infograf768 infograf768 - change - 5 Sep 2018
Labels Added: J3 Issue
avatar infograf768 infograf768 - labeled - 5 Sep 2018
avatar zero-24 zero-24 - change - 5 Sep 2018
Labels Added: ?
avatar zero-24 zero-24 - labeled - 5 Sep 2018
avatar brianteeman
brianteeman - comment - 5 Sep 2018

OK I tried and hit the same problem. I can change it so that the select is displayed but I cant get that data into the edit form

avatar infograf768
infograf768 - comment - 5 Sep 2018

What have you done to get it to stick to something else than en-GB site ?
I could not do that here.

avatar brianteeman
brianteeman - comment - 5 Sep 2018

ah never tested that - it always returns to the first item :(

I am guessing it is because the values in the select are a combination of language and client eg value=en-gb1

avatar infograf768
infograf768 - comment - 9 Sep 2018

Succeeded in getting the filter to stick to the value chosen.

screen shot 2018-09-09 at 08 40 53

But it is not yet propagated to the new override.

avatar wilsonge
wilsonge - comment - 10 Sep 2018

Closing as we have a PR with #22105

avatar wilsonge wilsonge - change - 10 Sep 2018
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2018-09-10 01:00:20
Closed_By wilsonge
avatar wilsonge wilsonge - close - 10 Sep 2018
avatar infograf768
infograf768 - comment - 10 Sep 2018

Please rather test #22107 which solves the usability.

avatar zero-24 zero-24 - change - 16 Sep 2018
Labels Removed: ?
avatar zero-24 zero-24 - unlabeled - 16 Sep 2018

Add a Comment

Login with GitHub to post a comment