Thanks for noticing that. I wrote that in by hand probably a little hasty.
Interesting! Thanks for testing it. That's basically exactly what I'm trying to do. Get
numRecords while running a task.
I'll try again in case I did something wrong
LIKE. They got the same exception.
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
- ERROR [Emergency]: Uncaught SilverStripe\ORM\Connect\DatabaseException: Couldn't run query:
- SHOW COLUMNS
- FROM MyTable
- WHERE my_column
- Unknown column 'my_column' in 'where clause'
You should be able to get the current Locale by the following which will return a Locale object you can retrieve the title from.
- $curr_locale = Locale::getCurrentLocale();
Check out the Locale class for more methods: https://github.com/tractorcow-farm/silverstripe-fluent/blob/master/src/Model/Locale.php
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.
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.
- - 'TractorCow\Fluent\Extension\FluentFilteredExtension'
- - 'TractorCow\Fluent\Extension\FluentVersionedExtension'
Thanks for your help @theruss 🙂