10389 Posts in 2200 Topics by 1712 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 317 Views |
-
How to Disable Translatable on Search Results

28 September 2012 at 11:14am Last edited: 28 September 2012 11:15am
We are running SS3 with Translatable.
If a search term is entered the following page comes up:
http://localhost.devsite/home/SearchForm?Search=book&action_results=GoWith the following error:
[Notice] Undefined property: Page::$Locale
GET /home/SearchForm?Search=book&action_results=Go
Line 542 in C:\source\devsite\translatable\code\model\Translatable.phpThe Source shown is:
533 * It falls back to "Locale='' OR Lang IS NULL" and assumes that
534 * this implies querying for the default language.
535 *
536 * Use {@link disable_locale_filter()} to temporarily disable this "auto-filtering".
537 */
538 function augmentSQL(SQLQuery &$query) {
539 // If the record is saved (and not a singleton), and has a locale,
540 // limit the current call to its locale. This fixes a lot of problems
541 // with other extensions like Versioned
542 $locale = ($this->owner->ID && $this->owner->Locale) ? $this->owner->Locale : Translatable::get_current_locale();
543 $baseTable = ClassInfo::baseDataClass($this->owner->class);
544 if(
545 $locale
546 // unless the filter has been temporarily disabled
547 && self::locale_filter_enabled()
548 // DataObject::get_by_id() should work independently of languageLine 536 suggests that this can be disabled, but I don't know how.
Any suggestions would be appreciated.
-
Re: How to Disable Translatable on Search Results

1 October 2012 at 1:30pm
Hi Tama,
If you update your version of Translatable it should fix this problem. The Locale variable wasn't being checked for properly so it would always crash when it found an object without it.
-
Re: How to Disable Translatable on Search Results

5 December 2012 at 6:29am Last edited: 5 December 2012 6:29am
Hey,
I got the same error. Updating didn´t solve the problem...
@Tama: Did this solve yours?Cheers,
Sash -
Re: How to Disable Translatable on Search Results

6 December 2012 at 12:43pm
Hi Sash
Yes, updating solved the problem for us.
Cheers
Tama -
Re: How to Disable Translatable on Search Results

10 May 2013 at 12:55pm
This commit resolved the issue for me
https://github.com/silverstripe/silverstripe-translatable/pull/39
Cheers
Gordon
| 317 Views | ||
|
Page:
1
|
Go to Top |


