luyadev / luya

LUYA is a scalable web framework and content management system with the goal to please developers, clients and users alike.
https://luya.io
MIT License
811 stars 205 forks source link

No new language page creation in cms clicking on flag in existing page #2050

Closed lbucche closed 4 years ago

lbucche commented 4 years ago

What steps will reproduce the problem?

Windows 10 platform, XAMPP setup -Server version: Apache/2.4.41 (Win64) -Apache Lounge VC15 Server built: Aug 11 2019 12:20:04 -PHP: 7.3.15 -Database: 10.4.11-MariaDB

Fresh install of luyadev/luya-kickstarter following official guide composer global require "fxp/composer-asset-plugin:~1.4" composer create-project luyadev/luya-kickstarter:^1.0 new env files prepare db/users luya migrate luya import luya admin/setup English homepage appears correctly.

Enter admin and add new languages with their short_codes (for instance italian). Let english as default language. Click on Homepage in CMS admin, then click on new flag to add new version of the homepage.

What is the expected result?

Normally admin ask me to create a new page or copy data from an existing version of the page, in this case the english one.

What do you get instead? (A Screenshot can help us a lot!)

The cms space splits vertically, but nothing appear under the clicked flag.

LUYA Check ouput (run this script and post the result: [luyacheck.php]

1: [in_array('mod_rewrite', apache_get_modules())] true 2: [ini_get('short_open_tag')] '' 3: [ini_get('error_reporting')] '22527' 4: [phpversion()] '7.3.15' 5: [php_ini_loaded_file()] 'C:\xampp\php\php.ini' 6: [php_sapi_name()] 'apache2handler' 7: [isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : unknown] 'Apache/2.4.41 (Win64) OpenSSL/1.1.1c PHP/7.3.15'

Additional infos

Already appened in the past but not clear the solution. (https://gist.github.com/nadar/022f890e064c068e75ce6178cd14a09e))

Chrome browser Versione 85.0.4183.102 (Build ufficiale) (a 64 bit) There's an error in browser console: DevTools failed to load SourceMap: Could not load content for http://localhost/testone/luya-kickstarter/public_html/assets/2b5a3dd6/dist/js/boolval.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

Q A
LUYA Version last
PHP Version 7.3.15
Platform Apache/XAMPP
Operating system Windows 10

no-page

nadar commented 4 years ago

What does the xhr response returns? The URL should be sth like nav-item?lang=...

lbucche commented 4 years ago

no-page-xhr1 no-page-xhr2

In the response only: {"error":true}

Something in the admin's js assets?

lbucche commented 4 years ago

If I right-click on the xhr request and open in new tab the url: http://localhost/testone/luya-kickstarter/public_html/admin/api-cms-navitem/nav-lang-item?langId=2&navId=1

I get:

Unauthorized Your request was made with invalid credentials. 0 401 yii\web\UnauthorizedHttpException
nadar commented 4 years ago

If I right-click on the xhr request and open in new tab the url:

yes, this is expected because then the authroization is failing.

What CMS and ADMIN and CORE version of LUYA are you using? show me your composer json or run composer update, because this error => true response is not available anymore in latest version. i assume the nav-lang-item? request is the one which returns error true?

lbucche commented 4 years ago

I tried with Postman with a valid Bearer Token and i found that:

$item = NavItem::find()->with('nav')->where(['nav_id' => $navId, 'lang_id' => $langId])->one();

in api/NavItemController don't find the record of the new page, because it doesn't exists and returns error=>true.

But why don't ask me to copy the english version and create the new page?

lbucche commented 4 years ago

A fresh install of the kickstarter composer.json

{ "name": "luyadev/luya-kickstarter", "description": "The kickstarter project for a new LUYA application.", "type": "project", "license":"MIT", "require": { "luyadev/luya-core" : "~1.0.0", "luyadev/luya-module-admin" : "~1.0.0", "luyadev/luya-module-cms" : "~1.0.0", "luyadev/luya-bootstrap3" : "~1.0.0", "luyadev/luya-generic" : "~1.0.0" }, "require-dev": { "yiisoft/yii2-gii" : "~2.0.0", "yiisoft/yii2-debug" : "~2.0.0", "luyadev/luya-testsuite" : "~1.0.0" }, "scripts": { "post-create-project-cmd": [ "yii\composer\Installer::postCreateProject" ] }, "extra": { "yii\composer\Installer::postCreateProject": { "setPermission": [ { "public_html/assets": "0777", "public_html/storage": "0777", "runtime" : "0777" } ] }, "branch-alias": { "dev-master": "1.0.x-dev" }, "asset-pattern-skip-version": "(-build|-patch)", "asset-installer-paths": { "bower-asset-library": "vendor/bower" } }, "config": { "fxp-asset" : { "pattern-skip-version": "(-build|-patch)", "installer-paths": { "bower-asset-library": "vendor/bower" } }
} }

nadar commented 4 years ago

uhh, thats very old :-)

see: https://github.com/luyadev/luya-kickstarter/blob/master/composer.json#L7-L11

nadar commented 4 years ago

so i don't think its a fresh installation?

lbucche commented 4 years ago

Yeahh! Now it works perfectly! I'm writing of "fresh install" in the sense of "made in this moment" whitout any other "personal addons or modifications".... ..but ok no matters. It works. Thank you very much and great Job!!!

nadar commented 4 years ago

perfect. enjoy. if you have questions please use forum.luya.io if you experience bugs or missing features, feel free to create an issue