Giter Site home page Giter Site logo

Comments (8)

Martimiz avatar Martimiz commented on August 14, 2024

Please check that the URL works with Translatable enabled, but without the LanguagePrefix module...

Discussion here: http://www.silverstripe.org/community/forums/general-questions/show/101333?start=8

from silverstripe-languageprefix.

Martimiz avatar Martimiz commented on August 14, 2024

Could you send me a MySQL dump of your test database? That would give me the russian content, which I can't create myself. Also your default Translatable locale?

from silverstripe-languageprefix.

dpezer avatar dpezer commented on August 14, 2024

My default Translatable locale is en_US. MySQL dump you can download here: http://error.si/data/sql_dump.zip

from silverstripe-languageprefix.

Martimiz avatar Martimiz commented on August 14, 2024

Thanks, got it :)

from silverstripe-languageprefix.

NightJar avatar NightJar commented on August 14, 2024

At a quick poke through I'd say this double escape is probably causing issues: https://github.com/Martimiz/silverstripe-languageprefix/blob/master/code/PrefixModelAsController.php#L74 - although the default charset is utf8 which should be fine, so I am not sure. But seems most likely since latin charsets likely won't be touched (since they're generally all lowercase numbers, letters, and hyphens anyway) which accounts for the majority of test cases (especially if transliterating).

The original ModelAsController uses sprintf to build a raw WHERE clause to pass directly in, rather than using the ORM, so needs the manual escape.

Alas I do not have a development environment on hand to debug this through.

The advantage of DataObject::get_one is that it caches - which is generally of little use here anyway unless someone makes the same search (for some bizarre reason) later on in their controller (for which they'd presumably already have the class instantiated for, having landed on the page they're looking for). So I don't think that needs changing. Hopefully just changing to $filter = array('URLSegment' => $URLSegment) should do the trick.

from silverstripe-languageprefix.

Martimiz avatar Martimiz commented on August 14, 2024

@NightJar: you were right on target, thanks :)

@Darianno: Could you check if the latest commit to master fixes your problem, so I can close this as fixed?

from silverstripe-languageprefix.

dpezer avatar dpezer commented on August 14, 2024

@Martimiz: I have checked. URL's are now working perfectly. Thank you!

from silverstripe-languageprefix.

Martimiz avatar Martimiz commented on August 14, 2024

Fixed in 7bb01b5

from silverstripe-languageprefix.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.