Administrator
- Join Date:
- Feb 2006
- Location:
- Tampa Bay, Florida
- Posts:
- 10,690
- Plugin Contributions:
- 56
Ceon URI Mapping V5.0
TY. Over to you, @strelitzia.
Views: 88,600
Administrator
TY. Over to you, @strelitzia.
Zen Follower
I am getting a 500 error when trying to go to the config page in admin for ceon Version: 5.1.0 from the GitHub using zencart v1.5.8a and php 8.1. I added a .htaccess file to the directory. I get the following error in my log files.
[10-Sep-2023 21:00:19 America/Los_Angeles] PHP Fatal error: Unparenthesized a ? b : c ? d : e is not supported. Use either (a ? b : c) ? d : e or a ? b : (c ? d : e) in /home/folder/domain.com/admin/includes/classes/class.CeonURIMappingInstallOrUpgrade.php on line 467
I must have done something wrong. Could use a hand as I am have been trying to figure this one out for hours.
New Zenner
@jasonshanks It's some PHP code in that file that needs brackets adding, e.g.:
'product_reviews' =>
isset($default_uri_parts[$default_language_code]['product_reviews']) ?
$default_uri_parts[$default_language_code]['product_reviews'] :
isset($default_uri_parts['en']['product_reviews']) ?
$default_uri_parts['en']['product_reviews'] : 'Reviews',
Should be something like:
'product_reviews' =>
isset($default_uri_parts[$default_language_code]['product_reviews']) ?
$default_uri_parts[$default_language_code]['product_reviews'] :
(isset($default_uri_parts['en']['product_reviews']) ?
$default_uri_parts['en']['product_reviews'] : 'Reviews'),
5 instances need replacing. I think you just have to edit it yourself, the latest blob at the repo I think is 'current' doesn't have this fix either. https://github.com/JSWebSteve/Ceon-URI-Mapping-V5.1.0/blob/main/files/admin/includes/classes/class.CeonURIMappingInstallOrUpgrade.php
Zen Follower
Thank you so much. I had uninstalled that copy out of frustration of not knowing what to do or how to find out. And was going to install 1.5.7 , but i think i will give it another shot. Thank you.
New Zenner
No worries. It's not the version of Zen Cart that's causing your problem, it's your PHP 8.1. I presume you had an earlier version last time this worked for you. From a quick search, see https://lindevs.com/nested-ternary-operators-requires-explicit-parentheses-in-php-8-0 "Since PHP 8.0, the nested ternary operators require explicit parentheses and using without them, a fatal error occurs."
I actually first ran into this in core Zen Cart, enable_error_logging.php used to have an ugly ternary operator when building its bitmask for log levels, but the latest version seems to have had this removed. A lot of work has been done by the faithful devs to fix a wide array of Errors since PHP 8.0, 8.1 and soon 8.2 turn old Deprecated warnings into Fatal Errors.
Zen Follower
neekfenwick:
@jasonshanks It's some PHP code in that file that needs brackets adding, e.g.:
'product_reviews' =>
isset($default_uri_parts[$default_language_code]['product_reviews']) ?
$default_uri_parts[$default_language_code]['product_reviews'] :
isset($default_uri_parts['en']['product_reviews']) ?
$default_uri_parts['en']['product_reviews'] : 'Reviews',
>
> Should be something like:
>
> ```
'product_reviews' =>
isset($default_uri_parts[$default_language_code]['product_reviews']) ?
$default_uri_parts[$default_language_code]['product_reviews'] :
(isset($default_uri_parts['en']['product_reviews']) ?
$default_uri_parts['en']['product_reviews'] : 'Reviews'),
5 instances need replacing. I think you just have to edit it yourself, the latest blob at the repo I think is 'current' doesn't have this fix either. https://github.com/JSWebSteve/Ceon-URI-Mapping-V5.1.0/blob/main/files/admin/includes/classes/class.CeonURIMappingInstallOrUpgrade.php
are these the 5 instances you mentioned ?
isset($default_uri_parts[$default_language_code]['product_reviews']) ?
$default_uri_parts[$default_language_code]['product_reviews'] :
isset($default_uri_parts['en']['product_reviews']) ?
$default_uri_parts['en']['product_reviews'] : 'Reviews',
'product_reviews_info' =>
isset($default_uri_parts[$default_language_code]['product_reviews_info']) ?
$default_uri_parts[$default_language_code]['product_reviews_info'] :
isset($default_uri_parts['en']['product_reviews_info']) ?
$default_uri_parts['en']['product_reviews_info'] : 'Review',
'product_reviews_write' =>
isset($default_uri_parts[$default_language_code]['product_reviews_write']) ?
$default_uri_parts[$default_language_code]['product_reviews_write'] :
isset($default_uri_parts['en']['product_reviews_write']) ?
$default_uri_parts['en']['product_reviews_write'] : 'Write a Review',
'tell_a_friend' => isset($default_uri_parts[$default_language_code]['tell_a_friend']) ?
$default_uri_parts[$default_language_code]['tell_a_friend'] :
isset($default_uri_parts['en']['tell_a_friend']) ?
$default_uri_parts['en']['tell_a_friend'] : 'Tell a Friend',
'ask_a_question' => isset($default_uri_parts[$default_language_code]['ask_a_question']) ?
$default_uri_parts[$default_language_code]['ask_a_question'] :
isset($default_uri_parts['en']['ask_a_question']) ?
$default_uri_parts['en']['ask_a_question'] : 'Ask a Question'
);
I tried doing the same thing to them all but still get 500 error. Gonna undo and try again.
Zen Follower
I guess i am messing something up. But i can't for the life of me figure it out.
'product_reviews' =>
isset($default_uri_parts[$default_language_code]['product_reviews']) ?
$default_uri_parts[$default_language_code]['product_reviews'] :
(isset($default_uri_parts['en']['product_reviews']) ?
$default_uri_parts['en']['product_reviews'] : 'Reviews'),
'product_reviews_info' =>
isset($default_uri_parts[$default_language_code]['product_reviews_info']) ?
$default_uri_parts[$default_language_code]['product_reviews_info'] :
(isset($default_uri_parts['en']['product_reviews_info']) ?
$default_uri_parts['en']['product_reviews_info'] : 'Review'),
'product_reviews_write' =>
isset($default_uri_parts[$default_language_code]['product_reviews_write']) ?
$default_uri_parts[$default_language_code]['product_reviews_write'] :
(isset($default_uri_parts['en']['product_reviews_write']) ?
$default_uri_parts['en']['product_reviews_write'] : 'Write a Review'),
'tell_a_friend' => isset($default_uri_parts[$default_language_code]['tell_a_friend']) ?
$default_uri_parts[$default_language_code]['tell_a_friend'] :
(isset($default_uri_parts['en']['tell_a_friend']) ?
$default_uri_parts['en']['tell_a_friend'] : 'Tell a Friend'),
'ask_a_question' => isset($default_uri_parts[$default_language_code]['ask_a_question']) ?
$default_uri_parts[$default_language_code]['ask_a_question'] :
(isset($default_uri_parts['en']['ask_a_question']) ?
$default_uri_parts['en']['ask_a_question'] : 'Ask a Question'
);
I changed all 5 of them to be like yours but still getting 500 on the admin config page.
New Zenner
jasonshanks:
I changed all 5 of them to be like yours but still getting 500 on the admin config page.
Your last one, ask_a_question, needs a final closing bracket.
'ask_a_question' => isset($default_uri_parts[$default_language_code]['ask_a_question']) ?
$default_uri_parts[$default_language_code]['ask_a_question'] :
(isset($default_uri_parts['en']['ask_a_question']) ?
$default_uri_parts['en']['ask_a_question'] : 'Ask a Question')
(the final bracket after 'Ask a Question' matches the one on the previous line before isset).
Zen Follower
neekfenwick:
Your last one, ask_a_question, needs a final closing bracket.
'ask_a_question' => isset($default_uri_parts[$default_language_code]['ask_a_question']) ?
$default_uri_parts[$default_language_code]['ask_a_question'] :
(isset($default_uri_parts['en']['ask_a_question']) ?
$default_uri_parts['en']['ask_a_question'] : 'Ask a Question')
> (the final bracket after 'Ask a Question' matches the one on the previous line before isset).
First off thank you so much again for taking the time to help someone like me. I honestly don't know where to add that. Could you please show me ? I don't know how to code anything unless its pretty much right in front of me and i can cut and paste.
Zen Follower
So i did a judo solution / temp fix. I just asked my host to downgrade my php to 7.4 which is what my main site has been running on with its 1.5.6 install. Now ceon works fine. I will try to watch some beginner videos on php so i can at least understand you guys when you try to help me. Again I apologize if i wasted your time. I know all of you do this stuff for free and I really appreciate everything all of you do.
New Zenner
jasonshanks:
I just asked my host to downgrade my php to 7.4
PHP 7.4 (anything before 8.0) has reached EOL (end of life) and will not receive security updates. I'm surprised your host allowed you to do it. See https://www.php.net/supported-versions.php .. so, you should get back on 8.x ASAP. Get yourself a decent code editor with syntax highlighting (I use VSCode with PHP extensions installed), when you paste your code in there's a clear indication that there is a syntax error. You can delete sections of the code to narrow down exactly which bit is causing the syntax error, then put the deleted bits back and fix the error. Best option is to have a local development web server so you can run the site on your own PC before putting any changed files on your main server, that's definitely something I would try to aim for, but it sounds like you're a way away from that yet .. try to find a buddy who can sit with you and work through these early pain points to get you up and running. Took me about 20 seconds to fix the ternary operator problem just from experience. Maybe send me a private message for help :)
zennedOut
neekfenwick:
PHP 7.4 (anything before 8.0) has reached EOL (end of life) and will not receive security updates.
the current LTS of debian, is buster or debian 10; which comes packaged with php 7.3. the debian team backports all security fixes to this php version.
to update to a later version of php when running buster involves the use of 3rd party repos. which comes with it's own security risks.
given that buster is only supported to 6/2024; it is probably a good idea to plan to move onto bullseye or bookworm if running debian.
but the idea that security fixes are not being done is much more dependent on the o/s that your server is running.
best.
Totally Zenned
Since I can't test on a 1.57 install, try this
$fallback_defines = [
'product_reviews' => $default_uri_parts[$default_language_code]['product_reviews'] ?? ($default_uri_parts['en']['product_reviews'] ?? 'Reviews'),
'product_reviews_info' => $default_uri_parts[$default_language_code]['product_reviews_info'] ?? ($default_uri_parts['en']['product_reviews_info'] ?? 'Review'),
'product_reviews_write' => $default_uri_parts[$default_language_code]['product_reviews_write'] ?? ($default_uri_parts['en']['product_reviews_write'] ?? 'Write a Review'),
'tell_a_friend' => $default_uri_parts[$default_language_code]['tell_a_friend'] ?? ($default_uri_parts['en']['tell_a_friend'] ?? 'Tell a Friend'),
'ask_a_question' => $default_uri_parts[$default_language_code]['ask_a_question'] ?? ($default_uri_parts['en']['ask_a_question'] ?? 'Ask a Question')
];
I don't get a debug on 1.58/2 but it goes back to the main CEON screen, not sure if it should do that or not....
Zen Follower
torvista:
Since I can't test on a 1.57 install, try this
$fallback_defines = [
'product_reviews' => $default_uri_parts[$default_language_code]['product_reviews'] ?? ($default_uri_parts['en']['product_reviews'] ?? 'Reviews'),
'product_reviews_info' => $default_uri_parts[$default_language_code]['product_reviews_info'] ?? ($default_uri_parts['en']['product_reviews_info'] ?? 'Review'),
'product_reviews_write' => $default_uri_parts[$default_language_code]['product_reviews_write'] ?? ($default_uri_parts['en']['product_reviews_write'] ?? 'Write a Review'),
'tell_a_friend' => $default_uri_parts[$default_language_code]['tell_a_friend'] ?? ($default_uri_parts['en']['tell_a_friend'] ?? 'Tell a Friend'),
'ask_a_question' => $default_uri_parts[$default_language_code]['ask_a_question'] ?? ($default_uri_parts['en']['ask_a_question'] ?? 'Ask a Question')
];
>
> I don't get a debug on 1.58/2 but it goes back to the main CEON screen, not sure if it should do that or not....
Steve It worked flawlessly , I just removed the whole section and added what you posted and now it passes all test. Thank you so much . I am so sorry I am only just now getting back to you. I had to put my test on hold till now. but this was my last stumbling block to upgrading.
Zen Follower
Just wanted to add , this was with my test site using php 8.1 and zencart 1.5.8. No error logs or anything. Everything works great.
Totally Zenned
Hi All,
I am running the latest version of zencart and the latest version of php 8.1. I have the paid version of ceon uri maping manager which I downloaded and installed to my test site. It also includes Ceon uri Mapping (SEO) Config which appears to be working ok.
This is the message that I am getting: This software cannot work without the latest version of Ceon URI Mapping: UMM Edition having already been installed. Please upgrade from the installed version of Ceon URI Mapping (Standard Edition 5.1.0) to Ceon URI Mapping: UMM Edition.
It is showing that I have installed version 5.1.0 according to the site I have installed it on.
The version that I have for Mappings Manager is 2.1.0 which I thought is correct because I downloaded from the ceon site.
After running a test I got this one message:
A file has had a modification made to it, for an older version of Ceon URI Mapping, but this modification is no longer needed.
The path to the file is /home/xxxxx/public_html/includes/extra_datafiles/ceon_uri_mapping_sessions_define.php
Although the file had to be modified for a previous version of the module, this version works differently and the file is not modified for this version.
Remove the modification from the file by editing the file and removing the block beginning with // BEGIN CEON URI MAPPING 1 of 1 and ending with // END CEON URI MAPPING 1 of 1 - including those two “marker comments”.
Alternatively, if the file was modified only for Ceon URI Mapping and not for any other module, back up the file (e.g. copy it to your local computer) and replace it with a “fresh” version of the file from a “fresh” set of Zen Cart files.
Any help would be appreciated
Totally Zenned
Bruce1952:
Hi All,
I am running the latest version of zencart and the latest version of php 8.1. I have the paid version of ceon uri maping manager which I downloaded and installed to my test site. It also includes Ceon uri Mapping (SEO) Config which appears to be working ok.
This is the message that I am getting: This software cannot work without the latest version of Ceon URI Mapping: UMM Edition having already been installed. Please upgrade from the installed version of Ceon URI Mapping (Standard Edition 5.1.0) to Ceon URI Mapping: UMM Edition.
It is showing that I have installed version 5.1.0 according to the site I have installed it on.The version that I have for Mappings Manager is 2.1.0 which I thought is correct because I downloaded from the ceon site.
After running a test I got this one message:
A file has had a modification made to it, for an older version of Ceon URI Mapping, but this modification is no longer needed.
The path to the file is /home/xxxxx/public_html/includes/extra_datafiles/ceon_uri_mapping_sessions_define.phpAlthough the file had to be modified for a previous version of the module, this version works differently and the file is not modified for this version.
Remove the modification from the file by editing the file and removing the block beginning with // BEGIN CEON URI MAPPING 1 of 1 and ending with // END CEON URI MAPPING 1 of 1 - including those two “marker comments”.
Alternatively, if the file was modified only for Ceon URI Mapping and not for any other module, back up the file (e.g. copy it to your local computer) and replace it with a “fresh” version of the file from a “fresh” set of Zen Cart files.Any help would be appreciated
This is what is in the file:
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
// Used to force the path for sessions to be at the root.
// Though this has been moved to init_ceon_uri_mapping_sessions.php to support
// loading if active and skipping if inactive.
// Static URIs are relative to the site's root, so cookie should be set for the root
// This removes the need to override the file includes/init_includes/init_sessions.php and means
// that the file includes/init_includes/overrides/init_sessions.php is not necessary.
// Override removal is applicable to the file structure used by ZC 1.3.9c and more recent.
// This is used with consideration that it is the only such use of CUSTOM_COOKIE_PATH.
// If another application defines CUSTOM_COOKIE_PATH to something else before the below define
// then this define will be of no value.
//define('CUSTOM_COOKIE_PATH', '/');
zennedOut
Bruce1952:
...
I have the paid version of ceon uri maping manager which I downloaded and installed to my test site. It also includes Ceon uri Mapping (SEO) Config which appears to be working ok.
.....
i would think a paid version of software would come with some support.
what do the good people at CEON say?
Totally Zenned
No reply as yet but then we have email issues at present.
Totally Zenned
Ceon.net have kindly released a new version of Ceon URI Mapping compatible with ZC v1.5.8
Version 5.1.1 was released on 4 Jan 2024
Tell staff why this post should be reviewed.