Jump to:

7940 Posts in 1543 Topics by 946 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Website Error upon Apostrophe

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 626 Views
  • Hibari
    Community Member
    9 Posts

    Website Error upon Apostrophe Link to this post

    Hey all, just had a question concerning the DOM functionality and an error that I'm getting.

    For the website that I'm using, we've set up a space for the admin to put in a specific content accordingly, the first input is for the date and that one is working good, however the content area seems to be having trouble.

    Upon inputting an ' (apostrophe) the page site will break with the generic "Website Error" After running the dev mode to look further into it, the problem seemed to be a bit bigger than I anticipated. The source area said this,

    529    function databaseError($msg, $errorLevel = E_USER_ERROR) {
    530       // try to extract and format query
    531       if(preg_match('/Couldn\'t run query: ([^\|]*)\|\s*(.*)/', $msg, $matches)) {
    532          $formatter = new SQLFormatter();
    533          $msg = "Couldn't run query: \n" . $formatter->formatPlain($matches[1]) . "\n\n" . $matches[2];
    534       }
    536       user_error($msg, $errorLevel);
    537    }
    539    /**
    540     * Return a boolean type-formatted string
    541     *
    542     * @param array $values Contains a tokenised list of info about this data type

    I'm wondering how I can automatically get the site to accept an apostrophe, even convert it to » if need be, but to do that everytime the apostrophe is input into the content area rather than falling apart. I believe the problem has to do with php reading apostrophes and trying to find what it's supposed to be referencing. Anybody got a possible fix for this?

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.