J4 Issue ?
avatar Chacapamac
Chacapamac
21 Mar 2019

Steps to reproduce the issue

Just Install Alpha 8 and create a multilingual site with Cassiopeia

Expected result

To have the french article ( Article (fr-fr) ) appear in front-end

Actual result

I get this error
Il n'y a aucun article dans cette catégorie. Si des sous-catégories sont affichées sur cette page, elles peuvent contenir des articles.

The article is present and publish —>
Article (fr-fr) Alias: article-fr-fr
Category: Catégorie (fr-fr)

System information (as much as possible)

Mamp — PHP 7.2.1 — MYSQL 5.6.38

Additional comments

avatar Chacapamac Chacapamac - open - 21 Mar 2019
avatar joomla-cms-bot joomla-cms-bot - labeled - 21 Mar 2019
avatar infograf768
infograf768 - comment - 21 Mar 2019

have you installed the multingual sample data through the module?
which precise url gives this result?

avatar franz-wohlkoenig franz-wohlkoenig - change - 21 Mar 2019
Status New Information Required
avatar Chacapamac
Chacapamac - comment - 21 Mar 2019

I install the new language and content language by the administration after I use the “Install Multilingual” with every notes of success + Multilingual Status OK.

What is weird I even verified that both menu items are pointing to the right (french/English) Category Blog and both article are in their right specific category. I think I will reinstall from scratch to see if I can repeat the problem.

The site is on my local Mamp.

avatar Chacapamac
Chacapamac - comment - 21 Mar 2019

Ok I just reinstall the full Alpha 8 everything work well but see these 2 screenshot something is up?
French-default-English-page
When French is default
The english page have a french title and no article — The french page is ok

English-default-French_page
When English is default
The french page have an english title and no article — The english page is ok

avatar franz-wohlkoenig franz-wohlkoenig - change - 22 Mar 2019
Status Information Required Discussion
avatar infograf768
infograf768 - comment - 22 Mar 2019

Will test with a clean install once #24300 is solved

avatar infograf768
infograf768 - comment - 22 Mar 2019

I confirm.

avatar infograf768
infograf768 - comment - 22 Mar 2019

The issue is with the router.

avatar franz-wohlkoenig franz-wohlkoenig - change - 22 Mar 2019
Category Multilanguage Multilanguage Router / SEF
avatar infograf768
infograf768 - comment - 22 Mar 2019

I am modifying the title of this Issue

avatar infograf768 infograf768 - change - 22 Mar 2019
Title
New Multilingual installation of Alpha 8 - No articles in this category on the French side of site?
[4.0] Multilang broken. Router issue!!
avatar infograf768 infograf768 - edited - 22 Mar 2019
avatar infograf768 infograf768 - change - 22 Mar 2019
Labels Added: J4 Issue
avatar infograf768 infograf768 - labeled - 22 Mar 2019
avatar infograf768
infograf768 - comment - 22 Mar 2019

This can be tested again on a 4.0-dev branch clean install.
Looks like it works fine for a monolingual site

avatar infograf768
infograf768 - comment - 22 Mar 2019

Hint: the issue is only when SEF is on.

avatar infograf768
infograf768 - comment - 22 Mar 2019

@SharkyKZ
could this be due to one of your prs merged recently?

avatar SharkyKZ
SharkyKZ - comment - 22 Mar 2019
avatar infograf768
infograf768 - comment - 22 Mar 2019

@SharkyKZ
it works fine in 3.9 and was working fine 3 days ago for 4.0
therefore, something has been modified in the last days that broke it.

avatar infograf768
infograf768 - comment - 22 Mar 2019

sorry, i now understand that some changes from 3.9 have been recently merged by @wilsonge in 4.0

avatar joeforjoomla
joeforjoomla - comment - 22 Mar 2019

I confirm, i had a Joomla 4 multilanguage website working since months, once installed the latest Alpha 8 all pages throw a 404. Disabling the multilanguage filter plugin fixes the problem, so it must be something merged in recent days about multilanguage.

avatar infograf768
infograf768 - comment - 23 Mar 2019

The issue is in the modification of the onAfterInitialise() method.
It was

	public function onAfterInitialise()
	{
		$this->app->item_associations = $this->params->get('item_associations', 0);

		if ($this->app->isClient('site'))
		{
			$router = $this->app->getRouter();
			// Attach build rules for language SEF.
			$router->attachBuildRule(array($this, 'preprocessBuildRule'), Router::PROCESS_BEFORE);
			$router->attachBuildRule(array($this, 'buildRule'), Router::PROCESS_BEFORE);
			if ($this->mode_sef)
			{
				$router->attachBuildRule(array($this, 'postprocessSEFBuildRule'), Router::PROCESS_AFTER);
			}
			else
			{
				$router->attachBuildRule(array($this, 'postprocessNonSEFBuildRule'), Router::PROCESS_AFTER);
			}
			// Attach parse rules for language SEF.
			$router->attachParseRule(array($this, 'parseRule'), Router::PROCESS_BEFORE);
		}
	}

it is now

	public function onAfterInitialise()
	{
		$this->app->item_associations = $this->params->get('item_associations', 0);

		// We need to make sure we are always using the site router, even if the language plugin is executed in admin app.
		$router = CMSApplication::getInstance('site')->getRouter('site');

		// Attach build rules for language SEF.
		$router->attachBuildRule(array($this, 'preprocessBuildRule'), Router::PROCESS_BEFORE);
		$router->attachBuildRule(array($this, 'buildRule'), Router::PROCESS_BEFORE);

		if ($this->mode_sef)
		{
			$router->attachBuildRule(array($this, 'postprocessSEFBuildRule'), Router::PROCESS_AFTER);
		}
		else
		{
			$router->attachBuildRule(array($this, 'postprocessNonSEFBuildRule'), Router::PROCESS_AFTER);
		}

		// Attach parse rules for language SEF.
		$router->attachParseRule(array($this, 'parseRule'), Router::PROCESS_DURING);
	}

This last one works fine in 3.9 but breaks 4.0

avatar joeforjoomla
joeforjoomla - comment - 23 Mar 2019

Thanks for the clarification @infograf768 ... waiting for someone more expert to fix it

avatar joeforjoomla
joeforjoomla - comment - 23 Mar 2019

I confirm that the previous version of onAfterInitialise solves the problem with multilanguage on J4 Apha 8

avatar SharkyKZ
SharkyKZ - comment - 23 Mar 2019

Using Router::PROCESS_BEFORE instead of Router::PROCESS_DURING here appears to fix the issue.

$router->attachParseRule(array($this, 'parseRule'), Router::PROCESS_DURING);

This needs a lot of testing.

avatar joeforjoomla
joeforjoomla - comment - 23 Mar 2019

I agree @SharkyKZ a lot of testing

avatar infograf768
infograf768 - comment - 23 Mar 2019

@SharkyKZ
tested that OK here.
But is'nt the main issue with the modifications of the getInstance() method in CMSApplication between 3.x and 4.0 ?

avatar infograf768 infograf768 - change - 24 Mar 2019
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2019-03-24 08:02:33
Closed_By infograf768
avatar infograf768
infograf768 - comment - 24 Mar 2019

Closing as we have a patch where this can be discussed further if necessary.
#24332

avatar infograf768 infograf768 - close - 24 Mar 2019

Add a Comment

Login with GitHub to post a comment