Issues using the elements service in console commands I'm having trouble getting the elements service working correctly in a consolecommand. The same code works as expected in a controller, so I expect there is either a bug, or some extra config I'm missing.

&lt;?php
namespace Craft;

class ShoppingCommand extends BaseCommand {

    public function actionListOrders() {
        $c = craft()-&gt;elements-&gt;getCriteria(ElementType::Entry);
        //$c-&gt;locale = craft()-&gt;i18n-&gt;getPrimarySiteLocale();
        $c-&gt;section = 'orders';
        $c-&gt;limit = 5;
        foreach($c as $o) {
            print $o-&gt;orderId . ": " . $o-&gt;title . ", " . $o-&gt;price . "\n";
        }
    }
}


running this results in the following

$ ./app/etc/console/yiic shopping listorders
: blah,


running the same action with a Controller in the webapp results in the expected output:

10: blah, 123


Anyone have any ideas if it's possible to get around this? For now I can just build my functionality into a controller, but it would be much more convenient if I could run it from the command line like this. 

Also, there is another issue with this relating to the locale. Originally I needed to use the commented out line above because my site's default locale was en where as the consolecommands default to en_us and without forcing the locale my queries were not returning any results at all. I changed my default locale to en_us to test whether the other issue was something to do with the locales as well, but it didn't make a difference.

Cheers

-Tristan
There was a bug in Craft where custom fields weren't being loaded when using the ElementsService in the context of a console command.

Just fixed it for the next (post 2.2.2598) release.

Am I'm not sure I'm following the locale issue.  Can you post that as a separate question with some more clarification?