Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web Installer // Multilanguage install process #17452

Closed
svenbluege opened this issue Aug 8, 2017 · 14 comments
Closed

Web Installer // Multilanguage install process #17452

svenbluege opened this issue Aug 8, 2017 · 14 comments

Comments

@svenbluege
Copy link
Contributor

svenbluege commented Aug 8, 2017

Steps to reproduce the issue

  1. start the web install process
  2. before removing the install folder click the "Extra Step: Install Languages" button
  3. select a language from the list
  4. click "next"

Expected result

  • a loading spinner appears
  • the loading spinner disappears but I'm in the second tab

Actual result

  • a loading spinner appears
  • the loading spinner disappears but I'm not in the second tab

System information (as much as possible)

Joomla 3.8.0-Dev

screen shot 2017-08-08 at 19 56 06

Additional comments

I encountered this issue while trying to install Joomla 3.8 with the JoomlaBrowser
https://github.com/joomla-projects/joomla-browser

The following error is visible in the browser if you click the "next" button a second time:

image

@mbabker
Copy link
Contributor

mbabker commented Aug 8, 2017

Can you check the browser's dev console to see if the network request is having any errors or if there's a JavaScript related issue?

@svenbluege
Copy link
Contributor Author

Sure. I added the screenshot to the initial post.

@svenbluege
Copy link
Contributor Author

svenbluege commented Aug 9, 2017

Just an addition. I checked the server return. My server had the error level pretty high so I see some notices which break the JSON response:

Notice: Undefined property: stdClass::$min_dev_level in /var/www/eventgallery/tests/joomla-cms3/libraries/src/Updater/Update.php on line 326
Call Stack
#	Time	Memory	Function	Location
1	0.2007	385760	{main}( )	.../index.php:0
2	0.2086	1077992	InstallationApplicationWeb->execute( )	.../index.php:32
3	0.2086	1077992	InstallationApplicationWeb->doExecute( )	.../CMSApplication.php:267
4	0.2092	1097856	InstallationApplicationWeb->dispatch( )	.../web.php:200
5	0.2118	1266008	InstallationControllerInstallLanguages->execute( )	.../web.php:161
6	0.2144	1278080	InstallationModelLanguages->install( )	.../languages.php:61
7	0.2196	1436200	InstallationModelLanguages->getPackageUrl( )	.../languages.php:164
8	0.2227	1441848	Joomla\CMS\Updater\Update->loadFromXml( )	.../languages.php:237
9	0.7021	1448488	xml_parse ( )	.../Update.php:483
10	0.7025	1453656	Joomla\CMS\Updater\Update->_endElement( )	.../Update.php:483

( ! ) Notice: Undefined property: stdClass::$max_dev_level in /var/www/eventgallery/tests/joomla-cms3/libraries/src/Updater/Update.php on line 327
Call Stack
#	Time	Memory	Function	Location
1	0.2007	385760	{main}( )	.../index.php:0
2	0.2086	1077992	InstallationApplicationWeb->execute( )	.../index.php:32
3	0.2086	1077992	InstallationApplicationWeb->doExecute( )	.../CMSApplication.php:267
4	0.2092	1097856	InstallationApplicationWeb->dispatch( )	.../web.php:200
5	0.2118	1266008	InstallationControllerInstallLanguages->execute( )	.../web.php:161
6	0.2144	1278080	InstallationModelLanguages->install( )	.../languages.php:61
7	0.2196	1436200	InstallationModelLanguages->getPackageUrl( )	.../languages.php:164
8	0.2227	1441848	Joomla\CMS\Updater\Update->loadFromXml( )	.../languages.php:237
9	0.7021	1448488	xml_parse ( )	.../Update.php:483
10	0.7025	1453656	Joomla\CMS\Updater\Update->_endElement( )	.../Update.php:483

Seems like this code is causing the notice messages:

	$patchMinimumSupported = $this->get('jversion.dev_level', Version::PATCH_VERSION) >= $this->currentUpdate->targetplatform->min_dev_level;
				$patchMaximumSupported = $this->get('jversion.dev_level', Version::PATCH_VERSION) <= $this->currentUpdate->targetplatform->max_dev_level;

```<hr /><sub>This comment was created with the <a href="https://github.com/joomla/jissues">J!Tracker Application</a> at <a href="https://issues.joomla.org/tracker/joomla-cms/17452">issues.joomla.org/tracker/joomla-cms/17452</a>.</sub>

@svenbluege
Copy link
Contributor Author

@mbabker I guess this commit causes the issue: wilsonge@e130087

Hope this helps. Seems like this is actually unrelated to the multilanguage category.

@mbabker
Copy link
Contributor

mbabker commented Aug 9, 2017

Ya, the isset checks from the block below the $patchMinimumSupported variable needs to be added to that line (same for the max).

@richard67
Copy link
Member

I can confirm that there are PHP notices shown on a 3.7.4 updated to 3.8.0-beta in the Joomla Update view on "Undefined property: stdClass::$min_dev_level" and other stuff related to the change of the version number variables. So there seems to be something wrong with that on updated systems but as it looks like it does not happen on clean staging installation.


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

@mbabker
Copy link
Contributor

mbabker commented Aug 9, 2017

The old constants are still present so that in and of itself is not an issue.

The issue is when processing update XML files that do not have min_dev_level and max_dev_level attributes on the targetplatform tag, the isset check needs to be moved up to be included in the $patch* variables.

$patchMinimumSupported = !isset($this->currentUpdate->targetplatform->min_dev_level) || Version::PATCH_VERSION >= $this->currentUpdate->targetplatform->min_dev_level

@infograf768
Copy link
Member

infograf768 commented Aug 10, 2017

Just found that too in 3.8.0 beta
#17462
It happens on clean staging install here.

@infograf768
Copy link
Member

Based on @mbabker suggestion, I tested this patch and do not get errors anymore:

diff --git a/libraries/src/Updater/Adapter/ExtensionAdapter.php b/libraries/src/Updater/Adapter/ExtensionAdapter.php
index 63e3043..b6d645e 100644
--- a/libraries/src/Updater/Adapter/ExtensionAdapter.php
+++ b/libraries/src/Updater/Adapter/ExtensionAdapter.php
@@ -125,11 +125,11 @@
 				 * Check for optional min_dev_level and max_dev_level attributes to further specify targetplatform (e.g., 3.0.1)
 				 */
-				$patchMinimumSupported = Version::PATCH_VERSION >= $this->currentUpdate->targetplatform->min_dev_level;
-				$patchMaximumSupported = Version::PATCH_VERSION <= $this->currentUpdate->targetplatform->max_dev_level;
+				$patchMinimumSupported = !isset($this->currentUpdate->targetplatform->min_dev_level) || Version::PATCH_VERSION >= $this->currentUpdate->targetplatform->min_dev_level;
+				$patchMaximumSupported = !isset($this->currentUpdate->targetplatform->max_dev_level) || Version::PATCH_VERSION >= $this->currentUpdate->targetplatform->max_dev_level;
 
 				if ($product == $this->currentUpdate->targetplatform['NAME']
 					&& preg_match('/^' . $this->currentUpdate->targetplatform['VERSION'] . '/', JVERSION)
-					&& ((!isset($this->currentUpdate->targetplatform->min_dev_level)) || $patchMinimumSupported)
-					&& ((!isset($this->currentUpdate->targetplatform->max_dev_level)) || $patchMaximumSupported))
+					&& $patchMinimumSupported
+					&& $patchMaximumSupported)
 				{
 					// Check if PHP version supported via <php_minimum> tag, assume true if tag isn't present
diff --git a/libraries/src/Updater/Update.php b/libraries/src/Updater/Update.php
index 5a3dfb0..d342f84 100644
--- a/libraries/src/Updater/Update.php
+++ b/libraries/src/Updater/Update.php
@@ -324,12 +324,12 @@
 				 * Check for optional min_dev_level and max_dev_level attributes to further specify targetplatform (e.g., 3.0.1)
 				 */
-				$patchMinimumSupported = $this->get('jversion.dev_level', Version::PATCH_VERSION) >= $this->currentUpdate->targetplatform->min_dev_level;
-				$patchMaximumSupported = $this->get('jversion.dev_level', Version::PATCH_VERSION) <= $this->currentUpdate->targetplatform->max_dev_level;
+				$patchMinimumSupported = !isset($this->currentUpdate->targetplatform->min_dev_level) || Version::PATCH_VERSION >= $this->currentUpdate->targetplatform->min_dev_level;
+				$patchMaximumSupported = !isset($this->currentUpdate->targetplatform->max_dev_level) || Version::PATCH_VERSION >= $this->currentUpdate->targetplatform->max_dev_level;
 
 				if (isset($this->currentUpdate->targetplatform->name)
 					&& $product == $this->currentUpdate->targetplatform->name
 					&& preg_match('/^' . $this->currentUpdate->targetplatform->version . '/', $this->get('jversion.full', JVERSION))
-					&& ((!isset($this->currentUpdate->targetplatform->min_dev_level)) || $patchMinimumSupported)
-					&& ((!isset($this->currentUpdate->targetplatform->max_dev_level)) || $patchMaximumSupported))
+					&& $patchMinimumSupported
+					&& $patchMaximumSupported)
 				{
 					$phpMatch = false;

@infograf768
Copy link
Member

@mbabker
Can you make the patch or shall I (if this above looks OK to you) ?

@mbabker
Copy link
Contributor

mbabker commented Aug 10, 2017

Would you do the patch please?

@infograf768
Copy link
Member

will do tmorrow

@richard67
Copy link
Member

Just ping me when the PR is ready so I can help with testing.

@infograf768
Copy link
Member

@svenbluege @AlexRed @richard67

Please test patch #17481

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants