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

Parse error: syntax error, unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM) in plugins\system\languagefilter\languagefilter.php on line 630 #19267

Closed
jsubri opened this issue Jan 3, 2018 · 13 comments

Comments

@jsubri
Copy link
Contributor

jsubri commented Jan 3, 2018

Steps to reproduce the issue

Staging (3.8.4-dev )with Multilingual Associations

Expected result

No error message

Actual result

Can't login, site broken

System information (as much as possible)

3.8.4-dev

Additional comments

modified line 630
from: $query = $this->app::getRouter()->parse($uri);
to: $query = $this->app->getRouter()->parse($uri);

@ghost
Copy link

ghost commented Jan 3, 2018

Can't confirm. Login works as expected.

System information

3.8.4-dev
Multilanguage Site (4 Lang.) & Test English (GB) Sample Data
macOS Sierra, 10.12.6
Firefox 57 (64-bit)

MAMP 4.2

@infograf768
Copy link
Member

It's weird though...
@csthomas
please look. It comes from
#19099

@jsubri
Copy link
Contributor Author

jsubri commented Jan 3, 2018

You need to have "System - Language Filter" enabled to reproduce the error

@csthomas
Copy link
Contributor

csthomas commented Jan 3, 2018

Yes, older php has a problem with that. I start to work on PR

@joomdonation
Copy link
Contributor

Honestly, I was scared when I saw #19099 merged. Haven't looked much as it but it seems it change existing behavior (you even need to change tests to have tests passed). There was also change in the to language filter plugin which seems not received code review yet, so to be safe, maybe it should go to 3.9.0 instead of to 3.8.4.

@csthomas
Copy link
Contributor

csthomas commented Jan 3, 2018

Please test PR #19268

@csthomas
Copy link
Contributor

csthomas commented Jan 3, 2018

The php code is not correctly parsed by php5:
$this->app::getRouter()->parse($uri);
so I changed it to:

$app = $this->app;
$app::getRouter()->parse($uri);

and now should be OK.

I tested:

<?php
        //Enter your code here, enjoy!

class O {
    public $a = null;
    
    function __construct($a) { $this->a = $a;}
    
    function printz() {
        //$this->a::getB()->printz(); // THIS IS NOT PARSED CORECTLY ON PHP 5
        $a = $this->a;
        $a::getB()->printz();
    }
}

class B {
    public function printz() { echo 'OK'; }
}

class A {
    public static function getB() { return new B(); }
}


$o = new O(new A());
$o->printz();

at http://sandbox.onlinephpfunctions.com/ on php 5.3 with success.

@brianteeman
Copy link
Contributor

(nite that this error message is only untranslated in PHP <5.5

@csthomas
Copy link
Contributor

csthomas commented Jan 3, 2018

Fix do not trigger the T_PAAMAYIM_NEKUDOTAYIM anymore on my php 5.6.26 however PR #19268 breaks (B/C) URLs like /index.php/fr/component/content/article/alias123?catid=13 that were working fine on 3.8.3 with modern routing.

@jsubri I moved it to this place.

The issue is that the link (without its own menu item) with removed IDs on the modern routing returns a 404 error is old and I have nothing to do with it yet:) At now it is only visible.

Yes, PR #19099 changed a way how build is a SEF link now. Early, it was hidden, joomla used Itemid from previous page or home page Itemid. Now everything is clearer.

If no menu assigned (to itself or parents) then /index.php/component/..., simple rule.

@csthomas
Copy link
Contributor

csthomas commented Jan 3, 2018

If the biggest problem is that this generates 404 then I will add a fix for that.

Then mentioned link
/index.php/fr/component/content/article/alias123?catid=13 will be looking like
/index.php/fr/component/content/article/category13alias/alias123 or depending of the hierarchy
/index.php/fr/component/content/article/parent-category/category13alias/alias123

@csthomas
Copy link
Contributor

csthomas commented Jan 3, 2018

I prepared a PR #19280 that fix issue with error 404 for links like /index.php/fr/component/content/article/alias123?catid=13

@joomla-cms-bot
Copy link

Set to "closed" on behalf of @Quy by The JTracker Application at issues.joomla.org/joomla-cms/19267

@Quy
Copy link
Contributor

Quy commented Jan 3, 2018

See PR #19280


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

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

7 participants