firecmsco / firecms

Awesome Firebase/Firestore-based CMS. The missing admin panel for your Firebase project!
https://firecms.co
Other
1.12k stars 184 forks source link

No collection for path: collectionName #638

Closed VisetDev closed 1 week ago

VisetDev commented 3 months ago

When trying to list a "type:reference" property under a subcollection, ErrorView arise:

image

Entities under subcollections stores references to documents under '/home/collections/visets' thus view configuration is as follow:

const reference = buildProperty({
        dataType: 'reference',
        path: "home/collections/visets",
        readOnly: true,
        name: 'In Collection',
        previewProperties: ["title"],
        columnWidth: 400,

});

onFetch(entity) log:

values: 
reference:  On2 
             id: "75b2b694dd42b88a8fc3"
             path: "home/collections/visets"

the same structure works fine if referenced collection is under root: '/visets' (for instance)

Collection '/home/collections/visets' is already created in firecms and works just fine.

My asumptions is somehow firecms reference path is not parsing paths in the form : "/collection/document/collection/" (deep further root)

fgatti675 commented 3 months ago

Hi @VisetDev, if you declared a subcollection with path visets under the home collection, then it's a bug on FireCMS. We will look into it and let you know

VisetDev commented 3 months ago

It's actually path: "home/collections/visets" where the reference points to (collection/document/collection) ... but you got the point. thx.

VisetDev commented 3 weeks ago

if I create it straight from firecms (app.firecms.co) the error still exists: image

VisetDev commented 3 weeks ago

it won't parse other than / collections:

`import { EntityCollection } from "firecms";

const ReferenceTestCollection:EntityCollection = {
    id: 'reference_test',
    name: 'reference test',
    singularName: 'reference test',
    path: 'reference_test',
    editable: true,
    icon: 'local_library',
    group: '',
    customId: false,
    properties: {
        time: {
            dataType: 'date',
            mode: 'date_time',
            name: 'time',
            propertyConfig: 'date_time',
        },
        elements: {
            name: 'elements',
            propertyConfig: 'reference',
            path: 'visets',
            dataType: 'reference',
        },
        collection: {
            dataType: 'reference',
            name: 'collection',
            propertyConfig: 'reference',
            path: '/home/collections/visets',
        },
    },
    subcollections: [],
}`
fgatti675 commented 1 week ago

Hi, I wasn't able to reproduce your issue. Make sure in your top level navigation you have a collection with path home, and that one needs to have a subcollection with path visets. Closing this for now