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

MODX 3 Errors with snippets #14687

Open
Ruslan-Aleev opened this issue Aug 20, 2019 · 9 comments

Comments

@Ruslan-Aleev
Copy link
Contributor

commented Aug 20, 2019

Bug report

Summary

  1. When trying to install a snippet, an error is written to the console, although the snippet is installed:
    MODX\Revolution\modX::loadClass is deprecated since version 3.0. Replace references to class modx.modNamespace with MODX\Revolution\modNamespace to take advantage of PSR-4 autoloading.

snippet

  1. When trying to unnistall / reinstall the snippet, an error is written to the console at each step, although the snippet is unnistalled / reinstalled:
    snippet2

  2. When a snippet is called in a resource (template, chunk or in content) - the page crashes with a 500 error.

Environment

MODX 3

@Mark-H

This comment has been minimized.

Copy link
Collaborator

commented Sep 1, 2019

The deprecation warnings are annoying - but not yet a problem. Extras will simply need to be updated to use the new namespaced names, which doesn't make sense to do until 3.0 is available.

I'm not reproducing the other errors you posted though. Perhaps it couldn't copy files because of file permissions?

I'm also not seeing a 500 error when using Wayfinder. If you can look at your server log for details, that would help to see if that's a core or extra issue.

@Ruslan-Aleev

This comment has been minimized.

Copy link
Contributor Author

commented Sep 1, 2019

Mark, are you using a linux server? Do you consider case sensitivity?

@Mark-H

This comment has been minimized.

Copy link
Collaborator

commented Sep 1, 2019

Tried on Mac OS/MAMP but I don't see where case sensitivity would be a problem here.

@Ruslan-Aleev

This comment has been minimized.

Copy link
Contributor Author

commented Sep 1, 2019

@Mark-H Unfortunately, I can’t check with the new changes, as I can’t install MODX3, although a couple of days ago there were no problems, #14707

@Ruslan-Aleev

This comment has been minimized.

Copy link
Contributor Author

commented Sep 3, 2019

@Mark-H So, I installed a clean, current MODX3, but when I call the snippet, I get an error of 500.

Here is the log:

[03-Sep-2019 17:28:47 Europe/Moscow] PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Wayfinder::__construct() must be an instance of modX, object given, called in /home/a/aleeviz8/m3/public_html/core/cache/includes/elements/modx/revolution/modsnippet/1.include.cache.php on line 43 and defined in /home/a/aleeviz8/m3/public_html/core/components/wayfinder/wayfinder.class.php:36
Stack trace:
#0 /home/a/aleeviz8/m3/public_html/core/cache/includes/elements/modx/revolution/modsnippet/1.include.cache.php(43): Wayfinder->__construct(Object(MODX\Revolution\modX), Array)
#1 /home/a/aleeviz8/m3/public_html/core/src/Revolution/modScript.php(88): include('/home/a/aleeviz...')
#2 /home/a/aleeviz8/m3/public_html/core/src/Revolution/modParser.php(504): MODX\Revolution\modScript->process(NULL)
#3 /home/a/aleeviz8/m3/public_html/core/src/Revolution/modParser.php(218): MODX\Revolution\modParser->processTag(Array, false)
#4 /home/a/aleeviz8/m3/public_html/core/src/Revolution/modFieldTag.php(59): MODX\Revolution\modParser->processElementTags('[[*content]]', '[[Wayfinder?\r\ in /home/a/aleeviz8/m3/public_html/core/components/wayfinder/wayfinder.class.php on line 36

Line 43 in snippet cache (1.include.cache.php):
$wf = new Wayfinder($modx,$scriptProperties);

Line 36 in wayfinder.class.php:

function __construct(modX &$modx,array $config = array()) {
...

Server OS - Ubuntu

@Ruslan-Aleev

This comment has been minimized.

Copy link
Contributor Author

commented Sep 3, 2019

Another 500 error was received in the manager panel while editing TV.

After saving the TV, a standard redirect occurred:
/manager/?a=Element/TemplateVar/Update&id=1

and the manager panel crashed with a 500 error, and the working link looks like this:

/manager/?a=element/tv/update&id=1

@JoshuaLuckers

This comment has been minimized.

Copy link
Collaborator

commented Sep 3, 2019

@Mark-H So, I installed a clean, current MODX3, but when I call the snippet, I get an error of 500.

Here is the log:

[03-Sep-2019 17:28:47 Europe/Moscow] PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Wayfinder::__construct() must be an instance of modX, object given, called in /home/a/aleeviz8/m3/public_html/core/cache/includes/elements/modx/revolution/modsnippet/1.include.cache.php on line 43 and defined in /home/a/aleeviz8/m3/public_html/core/components/wayfinder/wayfinder.class.php:36
Stack trace:
#0 /home/a/aleeviz8/m3/public_html/core/cache/includes/elements/modx/revolution/modsnippet/1.include.cache.php(43): Wayfinder->__construct(Object(MODX\Revolution\modX), Array)
#1 /home/a/aleeviz8/m3/public_html/core/src/Revolution/modScript.php(88): include('/home/a/aleeviz...')
#2 /home/a/aleeviz8/m3/public_html/core/src/Revolution/modParser.php(504): MODX\Revolution\modScript->process(NULL)
#3 /home/a/aleeviz8/m3/public_html/core/src/Revolution/modParser.php(218): MODX\Revolution\modParser->processTag(Array, false)
#4 /home/a/aleeviz8/m3/public_html/core/src/Revolution/modFieldTag.php(59): MODX\Revolution\modParser->processElementTags('[[*content]]', '[[Wayfinder?\r\ in /home/a/aleeviz8/m3/public_html/core/components/wayfinder/wayfinder.class.php on line 36

Line 43 in snippet cache (1.include.cache.php):
$wf = new Wayfinder($modx,$scriptProperties);

Line 36 in wayfinder.class.php:

function __construct(modX &$modx,array $config = array()) {
...

Server OS - Ubuntu

This issue is known, PR #14704 should fix this.

@JoshuaLuckers

This comment has been minimized.

Copy link
Collaborator

commented Sep 3, 2019

Another 500 error was received in the manager panel while editing TV.

After saving the TV, a standard redirect occurred:
/manager/?a=Element/TemplateVar/Update&id=1

and the manager panel crashed with a 500 error, and the working link looks like this:

/manager/?a=element/tv/update&id=1

Confirmed.

@JoshuaLuckers

This comment has been minimized.

Copy link
Collaborator

commented Sep 7, 2019

Another 500 error was received in the manager panel while editing TV.

After saving the TV, a standard redirect occurred:
/manager/?a=Element/TemplateVar/Update&id=1

and the manager panel crashed with a 500 error, and the working link looks like this:

/manager/?a=element/tv/update&id=1

This issue should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.