Quote

We're also available for Custom Joomla Development

Hire us now

Xtypo and very long article issue

Hello
using XTypo on a J! 3.4.1 site, very long articles (around 25 pages of printed text) don't work. I get blank content with this error:
Warning: preg_replace(): Compilation failed: regular expression is too large at offset 90492 in /var/www/vhosts/vorrei.org/httpdocs/plugins/content/xtypo/xtypo.php on line 118

disabling XTypo it works fine
How can I fix it?
Thanks
Resolved
The discussion has been resolved.
20 responses Add Yours
       
  • Replied by admin on Sunday, May 24 2015, 11:40 PM · Hide· #1
    HI theant, sorry for delay in responding due to weekend offline.
    Regarding your problem it probably because the the long content you have make joomla reaches the PHP regular expression limit you have on your server. Can you try to modify the file /plugins/content/xtypo/xtypo.php and add this code on the top of page (after the opening <?php tag ) so it will become :

    <?php
    ini_set("pcre.backtrack_limit", "150000");
    ini_set("pcre.recursion_limit", "150000");
    
    /**
     * XTypo: Plugin for Content
     * @version		$Id: xtypo.php 2.1


    Once it is modified, clear your cache and reopen your website.
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
  •  
  • Replied by theant on Monday, May 25 2015, 06:39 AM · Hide· #2
    Warning: preg_replace(): Compilation failed: regular expression is too large at offset 89832 in /var/www/vhosts/vorrei.org/httpdocs/plugins/content/xtypo/xtypo.php on line 120
  •  
  • Replied by admin on Monday, May 25 2015, 07:09 AM · Hide· #3
    HI, Can you let me know the URL of your site so I can take a look?
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
  •  
  • Replied by theant on Monday, May 25 2015, 07:15 AM · Hide· #4
    Yes, but that article is unpublished due the issue:
    http://www.vorrei.org/
  •  
  • Replied by admin on Monday, May 25 2015, 07:18 AM · Hide· #5
    Ah I see, so the error affected to one article only?
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
  •  
  • Replied by theant on Monday, May 25 2015, 10:17 AM · Hide· #6
    Yes, only that one so long
  •  
  • Replied by admin on Monday, May 25 2015, 11:53 PM · Hide· #7
    how about to increase the limit to
    ini_set("pcre.backtrack_limit", "300000");
    ini_set("pcre.recursion_limit", "300000");
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
  •  
  • Replied by theant on Tuesday, May 26 2015, 05:26 AM · Hide· #8
    No changes:
    http://www.vorrei.org/persone/10972-il-leader-post-ideologico-del-centro-sinistra.html
  •  
  • Replied by admin on Tuesday, May 26 2015, 12:44 PM · Hide· #9
    Hi Theant,
    is it possible for you to send me this 25 pages long article (including position of the xtypo tag) so I can make some tests on my local computer? If it's possible please send it via email to : support -at- templateplazza dot com
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
  •  
  • Replied by theant on Tuesday, May 26 2015, 01:24 PM · Hide· #10
    Sent. Thanks
  •  
  • Replied by admin on Tuesday, May 26 2015, 02:43 PM · Hide· #11
    Hi theant,
    I didn't receive it, are you sure you have sent it to correct email address?
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
  •  
  • Replied by theant on Tuesday, May 26 2015, 02:58 PM · Hide· #12
    Sent again, please check it.
  •  
  • Replied by theant on Tuesday, May 26 2015, 05:47 PM · Hide· #13
    Have you recieved the email?
  •  
  • Replied by admin on Tuesday, May 26 2015, 11:16 PM · Hide· #14
    Hi no, I haven't received it. How did you send it?
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
  •  
  • Replied by theant on Wednesday, May 27 2015, 06:34 AM · Hide· #15
    I'm attaching it at this post. Please, let me know.
  •  
  • Replied by theant on Wednesday, May 27 2015, 06:42 AM · Hide· #16
    You can download the article souce here: vorrei.org/article.txt
  •  
  • Replied by admin on Wednesday, May 27 2015, 03:35 PM · Hide· #17
    Hmm ok,
    let me make some test and back to you soon
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
  •  
  • Replied by admin on Friday, May 29 2015, 12:58 AM · Hide· #18
    Hi Theant,
    I found the problem. It because you use the xtypo tag (xtypo_rounded2) to cover an extremely large text sections, which is definitely will hit your server configuration limit.
    It's also not a good practice to cover such a huge amount of text with the xtypo_tag because xtypo uses regex to find/scan which text will be styled.

    The solution is to use xtypo button instead of using xtypo tag. Xtypo button inserts the necessary html code directly to your content so the xtypo plugin won't scan your content anymore because the xtypo_tag is no longer exist on that article

    Please see how to do that in this video https://www.dropbox.com/s/jbjvdltp60k8gtn/xtyporounded2.mp4?dl=0

    Hope this helps
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
  •  
  • Replied by theant on Friday, May 29 2015, 06:18 AM · Hide· #19
    Thanks a lot, it works.
  •  
  •  
    Replied by admin on Friday, May 29 2015, 06:43 AM · Hide· #20
    Nice. Glad it works
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
Your Response
Please login first in order for you to submit comments