Expresso
ExpressionEngine 2, ExpressionEngine 3, ExpressionEngine 4, ExpressionEngine 5
Back to this add-on's main page
View Other Add-ons From PutYourLightsOn
Error message when I add stuff for curly quotes
Support (Resolved)
strudelmedia design
|
Posted: 10 August 2019 12:08 AM |
|
|
|
Hi,
I’ve changed the ft.expresso.php file (per recommendations earlier here) so that I get typographically-correct quotes and apostrophes; my Replace Tag looks like this at the top:
/** * Replace Tag */ public function replace_tag($data, $params = array(), $tagdata = false) { $data = str_replace('"', '"', $data); $data = str_replace(''', '’', $data); $options = array( 'text_format' => 'xhtml', 'html_format' => 'all' );
This works on various sites I have, but I’ve now got a site running EE4 and Expresso 5.3.1 and I’m getting the following error message when I go to edit Fields or access Addons:
Fatal error: Cannot redeclare class Expresso_ft in /pathtosystem/user/addons/expresso/ft.expresso.php on line 792
Any idea what I’m doing wrong here, or what I should do so that I can continue to get curly quotes?
Thanks!
|
|
|
PutYourLightsOn
|
Posted: 10 August 2019 08:19 AM |
# 1
|
|
Developer
|
As per the error message, have you redeclared the `Expresso_ft` class on line 792?
|
|
|
strudelmedia design
|
Posted: 10 August 2019 08:23 AM |
# 2
|
|
|
I’m not sure what that means—I didn’t change anything in the file except those lines above.
|
|
|
strudelmedia design
|
Posted: 10 August 2019 08:25 AM |
# 3
|
|
|
This is the end of the file, if that helps:
// --------------------------------------------------------------------
/** * Checks if is valid license */ private function _valid_license($string) { return preg_match("/^([a-z0-9]{8})-([a-z0-9]{4})-([a-z0-9]{4})-([a-z0-9]{4})-([a-z0-9]{12})$/", $string); } }
/* End of file ft.expresso.php */
|
|
|
PutYourLightsOn
|
Posted: 10 August 2019 08:28 AM |
# 4
|
|
Developer
|
Hmm I see. What version of Expresso is installed?
|
|
|
strudelmedia design
|
Posted: 10 August 2019 08:29 AM |
# 5
|
|
|
5.3.1—and it works fine so far except when I add that code.
|
|
|
PutYourLightsOn
|
Posted: 10 August 2019 08:50 AM |
# 6
|
|
Developer
|
Something else in the file must have been changed. If you now comment out those 2 lines then does it still throw an error? If so then I’d recommend you start with the original file again to rule out characters added by accident.
|
|
|
strudelmedia design
|
Posted: 10 August 2019 09:02 AM |
# 7
|
|
|
Okay! Apparently something strange got copied into the file because when I commented out the two lines it still gave the error. So I put the two lines in BBedit and copied it back in and now it’s working!
Thanks so much for heading me in the right direction! I really appreciate the support!
|
|
|
PutYourLightsOn
|
Posted: 10 August 2019 09:11 AM |
# 8
|
|
Developer
|
Sure thing!
|
|
|