Comments (8)
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.
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.
My default Translatable locale is en_US. MySQL dump you can download here: http://error.si/data/sql_dump.zip
from silverstripe-languageprefix.
Thanks, got it :)
from silverstripe-languageprefix.
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.
@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.
@Martimiz: I have checked. URL's are now working perfectly. Thank you!
from silverstripe-languageprefix.
Fixed in 7bb01b5
from silverstripe-languageprefix.
Related Issues (17)
- Prevent Translatable appending locale to a URL HOT 1
- cannot call action on homepage HOT 1
- Language prefix not used in CMS split view HOT 19
- URLSegment same on various languages -> another solution? HOT 5
- Use default locale without language prefix HOT 42
- Multi-byte character strings immediately after language prefix cause a 404 HOT 3
- How to handle SS- built-in routes/controllers HOT 1
- Inserting Link with HTML Editor HOT 3
- after change Translatable::set_default_locale from EN to LT home page not found HOT 3
- How to hide the main language prefix HOT 1
- release tagged versions HOT 6
- 404 on Homepage HOT 4
- Fatal error: Call to a member function getURLPrefix() on null in /var/www/html/languageprefix/code/LanguagePrefix.php on line 203 HOT 8
- enable_duplicate_urlsegments HOT 1
- SS4 Compatible Version HOT 1
- Silverstripe 4 Namespacing & Compatibility HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from silverstripe-languageprefix.