ERROR TypeError: Cannot read property '__source' of undefined - spartacus-storefront

Since I upgrade to the new spartacus version (1.5) I've seen this bug in the console. It's came from SiteContextComponentService.getInjectedService.
I have not implemented nor used yet this service. How I can fix this bug? Cause I strongly believe is the origin of other little problems in my develop environment.

If you use 'CMSSiteContextComponent' component type (flextype?), then it should come with the context cms component data from the backend. Please check if the response contains it.

So the origin of the error was that in the GET /pages request I was not receiving the context attribute neither in the LanguageComponent nor the CurrencyComponent.

Related

Syntax error handling in dojo 18n resource file

require(["dojo/i18n!myapp/nls/extTools_i18nStrings"],function(extTools_i18nStrings){
// Do something with the loaded file
});
If the resource file (extTools_i18nStrings) has syntax error, it will be shown in dojo.js. How can I handle it in my code?
Try catch block did not work.
Thanks in advance.
Error: Script error .............dojo.js:15
The quick answer is you don't want to. The right thing to do is fix the bundle. This is the same as having errors in your application code, and you would not expect the code to 'handle' that.
But since i18n is an AMD plugin running as part of the loader (which is why you can't try/catch it), the error might be reported through the AMD micro event API, and you could use that to show a better error. I'm not sure how you 'handle' this syntax error other than showing an error.
If you can't control the quality of the bundles via some part of your development or build process you'd have to invent your own alternative to dojo/i18n and you probably don't want to go down that route for all of your bundles.

Ember-data 1.0.0-beta.19: store.find() returns DS.INTERNALMODEL instances

I have update Ember-data to 1.0.0-beta.19 and now store.find('events') resolved promise returns DS.INTERNALMODEL instances, instead of DS.MODEL. With Ember-data 1.0.0-beta.18 it was working fine. Any ideas?
UPDATE
At the end i found out that somewhere in my app code i was using Ember-data internal code like store.find('events.content'), causing an exception. The debugger was not so helpful tracing it, but removing this fixed my issue.
This is a bug, if the promise resolves with DS.InternalModel, those are only for internal use of Ember-Data and shouldn't be exposed to user code. Please file a bug if this is still a problem
This is on purpose. It's noted in the chanelog:
#3094 Lazily materialize DS.Models for app code, use InternalModel inside ED otherwise
It should work largely with no issues. Are you having issues with it?
You can access the DS.Model using InternalModel.record

Laravel Multi Auth set up issue

I have installed Multi Auth following instructions by ollieread at https://github.com/ollieread/multiauth, but i'm missing some point here.
I got this error when running my app before replacing the configuration for auth (config/auth.php):
ErrorException
Missing argument 1 for Illuminate\Auth\AuthManager::createDriver(), called in /private/var/www/portal-varejo/www/vendor/laravel/framework/src/Illuminate/Support/Manager.php on line 81 and defined
Im pretty sure that whats missing is this (from documentation):
Custom Auth Drivers
At this current moment in time, custom Auth drivers written for the base Auth class will not >work. I'm currently looking into this particular issue but for the meantime, you can work >around this by changing your closure to return an instance of Ollieread\Multiauth\Guard >instead of the default.
How can i do that? What closure i'm supposed to change?
Running Laravel 4.1 here.
You need to comment out 'Illuminate\Auth\AuthServiceProvider' and 'Illuminate\Auth\Reminders\ReminderServiceProvider' from app/config/app.php.

ceilometer api giving an error : 'str' object is not callable

I have to use the ceilometer api and whenever I type
root#osgrizzly:~# ceilometer meter-list
'str' object is not callable
I am not sure why is this error coming and what should i do to solve it. I googled it but still no answer, Can somebody please help me....
To tell about this system . I am manually installing ceilometer.
Also the compute ,collector and central agents are running fine and feeding data to mongodb
I was facing the same issue. Ensure that the username password you are using in ceilometerclient/shell.py is correct.

Enabling REST on HMVC CodeIgniter setup

I have just finished setting up an HMVC CodeIgniter following the steps here.
I am now trying to create a module "api" which I wish to use Phil Sturgeon's REST library.
It states here that I need to extend the MX_Controller rather than the CI_Controller and I did.
My initial setup was like this
application
--modules
----api
------config
------controller
------libraries
I kept getting an error with loading Rest_Controller so I have tried moving the REST_Controller and Format libraries to application/libraries that seemed to fix the loading issue but now i am getting the error below whenever i try to access it via http://example.com/codeigniter/index.php/api/example/user/id/1/format/json
"An Error Was Encountered
Unable to load the requested class: security"
I am expecting for the output to be "{"id":1,"name":"Some Guy","email":"example1#example.com","fact":"Loves swimming"}"
What am I missing? Would it be possible to keep the REST_Controller and Format libraries under the api module? If so, how?
Source
Open Rest_Controller.php go to line 173 and change the following code
$this->load->library('security');
to
$this->load->helper('security');
EDIT:
To have the REST_Controller and Format libraries under the api module.
Move the REST_Controller to api/controllers/REST_Controller.php and Format to api/libraries/Format.php