Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

Quick fix for deprecated warning filling up error log about $modx->sendRedirect #183

Open
jgulledge19 opened this issue May 24, 2019 · 0 comments

Comments

@jgulledge19
Copy link

Related in error log:

[2019-05-24 04:45:02] (ERROR @ www/core/cache/includes/elements/modplugin/13.include.cache.php : 298) sendRedirect method parameter $type is deprecated since version 2.0.5. Use type in options array instead.
[2019-05-24 04:45:02] (ERROR @ www/core/cache/includes/elements/modplugin/13.include.cache.php : 298) sendRedirect method parameter $responseCode is deprecated since version 2.0.5. Use responseCode in options array instead.

Related deprecated code:

stercseo.plugin.php#L298

$modx->sendRedirect($url, 0, 'REDIRECT_HEADER', 'HTTP/1.1 301 Moved Permanently');

MODX->sendRedirect

Fix for code:

$modx->sendRedirect($url, ['responseCode' => 'HTTP/1.1 301 Moved Permanently']);
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant