Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non core entity types are not retrieved #85

Open
duarteoctavio opened this issue Jul 24, 2023 · 4 comments
Open

Non core entity types are not retrieved #85

duarteoctavio opened this issue Jul 24, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@duarteoctavio
Copy link

Describe the bug
Entities of the type profile are not obtained when using the fetch method. Trying to retrieve them using the farm.fetch('profile', 'common') without success.

To Reproduce
Steps to reproduce the behavior:

  1. Initiate a farmos object, a farm which includes the desired profile--common schema is ourscitest. Here is the schema.
  2. Fetch all entities.
  3. If you try to call the methods associated with core types such as log, they work, but there's nothing similar for profile.
@duarteoctavio duarteoctavio added the bug Something isn't working label Jul 24, 2023
@jgaehring
Copy link
Member

Hm, oh interesting. I'll confess I did not do much to test fetching actual profiles themselves, just the schemata. I can take a closer look later this week, but my first intuition is to find out if it works to fetch the resource with farm.request('/api/profile/common') and/or with curl or some other API tooling.

@duarteoctavio
Copy link
Author

Sorry! I meant the schema. I used entity across the whole issue, but I really meant the schema for those en entity types.

@jgaehring
Copy link
Member

Hey, sorry I haven't found a chance to connect synchronously. Best to email me if you want to schedule something, or I can just respond here.

I just tried this test again on my local machine, and it still works for me:

farm.remote.authorize(username, password)
.then(() => farm.schema.fetch())
.then((res) => {
farm.schema.set(res);
const commonSchemata = farm.schema.get('profile', 'common');
console.log('common attributes:\n', Object.keys(commonSchemata.properties.attributes.properties));
const commonProfile = farm.profile.create({ type: 'profile--common', name: 'Maggie\'s Farm' });
console.log('commonProfile:\n', commonProfile);
})

The only changes I made to farmOS.js on top of main are the test itself, which I originally wrote way back when first testing these profile entities, plus 7e2bc25 to reflect the changes in #67. And main has only 2 commits (a non-code commit, 63c0479, and a bit of extra testing added, 98d2b39) ahead of the latest version 2.0.0-beta.16, which I released back in February to include the changes for subrequests #83.

My farmOS installation is version 2.x-dev, with the farm_profile and farm_profile_common modules installed. I think it was last updated March 2022, but maybe something has changed server-side since then, either in the modules or farmOS core?

@mstenta, any guesses if something might have changed on that end? And what's the best way to pin down the specific version/commit on my local?

@mstenta
Copy link
Member

mstenta commented Jul 31, 2023

Hmm nothing has changed that would affect the ability to fetch common profile schema... not that I can think of anyway. 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

3 participants