Closed v3ss0n closed 6 years ago
I import it the same way in 2.11-beta and it works correctly. I'd try nombom just in case the plugin wasnt installed successfuly.
i am testing on 2.10 , ok i will try nombom.
Hi @v3ss0n thanks for reporting. But I also can't reproduce it. Did nombom work? Otherwise if you can make a test case or show the repo, that'd be great.
@oskarrough i found the problem. i did a new ember app and tested ember-wordpress , and working fine , what it doesn't work is when application had defined own adapter. In our production we are using REST so it looks like this.
//adapters/application.js
import DS from 'ember-data';
import ENV from '../config/environment';
if (ENV.environment === 'development') {
var host = ENV.localHost
} else if (ENV.environment === 'production') {
var host = ENV.remoteHost
}
export default DS.RESTAdapter.extend({
host: host,
hexColorsArray: ['#fcb851', '#e64053', '#55bcb6', '#77edb2'],
ajax(url, method, hash) {
hash = hash || {};
hash.crossDomain = true;
hash.xhrFields = {
withCredentials: true
};
return this._super(url, method, hash);
}
})
then it tried to access http://host:port/posts
, ignoring what defined in environment.js
If it helps, you can try to extend the ember-wordpress adapter. In your example above the namespace
for the WP-API seems to be misisng.
https://github.com/oskarrough/ember-wordpress/blob/master/addon/adapters/wordpress.js
As soon as i install ember-wordpress , all others models are having trouble:
question: this.store.query('latestquestion', param),
post: this.store.findAll('post')
Error while processing route: login Assertion Failed: You must include an 'id' for latestquestion in an object passed to 'push' Error
it all works fine without ember-wordpress , its a bug?
@v3ss0n could very well be. But since it apparently only affects Ember 2.10? I won't take the time to support it. If anyone wants to they are very welcome :)
It can't find it normally , so i tried importing but that also fails: