Jun 19

Contao, formerly known as Typolight, comes with a lot of extensions and plugins available through its Extension Repository. In there isĀ  a little extension called “hyphenation”, providing support for frontend integration of Google-hosted JavaScript-based hyphenator script. Its integrating well in Contao implying little change to existing system UI. But as of current release the plugin includes a bug heavily limiting its capabilities.

If you encounter trouble on trying to enable this plugin on a site’s whole tree of pages by enabling it once in the site’s root node it might be due to the bug the following file replacement is going to fix. In addition this fix will enhance the integration of hyphenation as it allows to enable hyphenation on a whole thread of your site’s tree. Previously it’s intentionally possible to apply it on a single page or a whole site’s tree with the latter recently not available without this fix.

How To Fix

Fixing this issue is made simple, but requires access to the files of your Contao installation. Process these steps to actually replace the buggy file by a fixed and functionally enhanced version:

  1. Download the replacing file:
  2. Due to being a server-side PHP script file it isn’t available as is, but moved into an archive and thus requires extraction, so unzip the file.
  3. Connect to your site’s webspace e.g. over FTP or SFTP using your favourite client software.
  4. Navigate to the site’s base folder (unless it’s open by default after connecting) and descend into subfolder
    system/modules/hyphenation
  5. For your own safety you might want to have a backup of file Hyphenation.php found there remotely.
  6. Upload the previously unzipped file (with the same name) to that remote folder.
  7. That’s it.

Of course, a copy of this file has been sent to the plugin’s developer for upstream inclusion through Extension Repository, so hopefully it will become available there quite soon as well.

2 Responses to “Fixing Contao-Plugin Hyphenation”

  1. jantheofel says:

    Hello,

    next time you find a bug like this please contact the extension maintainer to fix it. I didn’t get an email or a ticket in the ticket system.

    Your fix is based on an old version of hypenation. Please don’t use it any more. If I understand the issue correct, the most simple way is to install the extension parentslist too. hypenation is based on it and the dependency seems to be missing in the extension repository.

    Please provide feedback and I will fix this in the official Contao extension repository. Thank you!

    Jan

    • Thomas Urban says:

      Hello Jan,

      nice to read you here.

      I’m quite curious about you saying that you haven’t got any mail on that issue. Please check your mail archives for the mails of June 14th, 2010 and you’ll probably find my initial post to you. On July 2nd, 2010 I got a response from you I responded to on July 3rd, 2010 in return. Since this post has been published on June 19th, 2010 the mail has been sent to you first. So, where is the problem.

      And yes, this fix is for an obviously outdated version of your extension as it has been published one year ago. There is no actual indication on this post for having updated the fix to work with more recent releases.

      Regarding my fix there hasn’t been any relation to a separate extension in code back in June 2010 as I was fixing use of a single query to database addressing page hierarchy directly. And the fix actually fixed a bug and extended the original functionality of your extension. In your response on July 2nd, 2010 you stated this additional feature to be less desirable due to probably including large JavaScript files on too many page requests on a site. BTW, considering that made me preferring server side hyphenation quite soon …

preload preload preload