Fieldtype

Developer
Supported

Expresso

ExpressionEngine 2, ExpressionEngine 3, ExpressionEngine 4, ExpressionEngine 5

Back to this add-on's main page
View Other Add-ons From PutYourLightsOn

     

You must be logged in to post.

Error message when I add stuff for curly quotes

Support (Resolved)

strudelmedia design
strudelmedia design

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
# 1
Developer
PutYourLightsOn

As per the error message, have you redeclared the `Expresso_ft` class on line 792?

strudelmedia design
# 2
strudelmedia design

I’m not sure what that means—I didn’t change anything in the file except those lines above.

strudelmedia design
# 3
strudelmedia design

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
# 4
Developer
PutYourLightsOn

Hmm I see. What version of Expresso is installed?

strudelmedia design
# 5
strudelmedia design

5.3.1—and it works fine so far except when I add that code.

PutYourLightsOn
# 6
Developer
PutYourLightsOn

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
# 7
strudelmedia design

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
# 8
Developer
PutYourLightsOn

Sure thing!