taoceanz

Thanks for noticing that. I wrote that in by hand probably a little hasty.

👍 (1)
taoceanz

Interesting! Thanks for testing it. That's basically exactly what I'm trying to do. Get numRecords while running a task.

taoceanz

I'll try again in case I did something wrong

taoceanz

I've tried LIKE. They got the same exception.

taoceanz

Is there a way to test whether a column exists on a custom table via the ORM? I'm getting this error when attempting to check if a column exists on a table. A simple query like SHOW COLUMNS FROM MyTable WHERE 'my_column' when run directly on the database returns an empty result and doesn't fail, but when accessing the database via something like DB::query('SHOW COLUMNS FROM MyTable WHERE 'my_column'); results in a DatabaseException.

  1. ERROR [Emergency]: Uncaught SilverStripe\ORM\Connect\DatabaseException: Couldn't run query:
  2.  
  3. SHOW COLUMNS
  4. FROM MyTable
  5. WHERE my_column
  6.  
  7. Unknown column 'my_column' in 'where clause'
taoceanz

You should be able to get the current Locale by the following which will return a Locale object you can retrieve the title from.

  1. $curr_locale = Locale::getCurrentLocale();
  2. $curr_locale->getTitle();

Check out the Locale class for more methods: https://github.com/tractorcow-farm/silverstripe-fluent/blob/master/src/Model/Locale.php

👍 (1)
taoceanz

I've tried to add FluentVersionedExtension to the Widget subclasses but it states the extension is applied incorrectly and should be made to the parent class i.e. Widget.

taoceanz

Is it possible to translate Widgets? I've added the following to yml config, though the Widget subclasses (which have private static $translate to define fields to be translated) aren't behaving as other pages and DOs that have been set to be filtered.

  1. SilverStripe\Widgets\Model\Widget:
  2. extensions:
  3. - 'TractorCow\Fluent\Extension\FluentFilteredExtension'
  4. - 'TractorCow\Fluent\Extension\FluentVersionedExtension'