apostrophecms / apostrophe-events

10 stars 5 forks source link

Extending events widget and using addFields breaks max limit fields #38

Open abea opened 5 years ago

abea commented 5 years ago

Having an addFields property in a module extending apos-events-widgets seems to break the limitByAll and limitByTag fields.

  label: 'Events',
  addFields: [
    {
      name: 'link',
      label: 'Link',
      type: 'singleton',
      widgetType: 'link'
    }
  ]
};

I'm getting some of the handy new warnings:

⚠️  widget type events, field name by:

showFields for the choice all includes limitByAll, a field that does not exist in the schema

⚠️  widget type events, field name by:

showFields for the choice tag includes limitByTag, a field that does not exist in the schema

Maybe worth double checking apos-blog?

boutell commented 5 years ago

I can't reproduce this in apostrophe-open-museum.

At no point did I see the behavior you're describing, nor does it make sense to me still as I look over the code. apostrophe-events-widgets has no addFields, and apostrophe-pieces-widgets plays the beforeConstruct game properly.

However, I encountered some weirdness in my attempt to reproduce the issue:

I think the alias thing would not really matter in practice if we fixed it so you can extend modules in a bundle as long as you're at least extending the root module of the bundle. That would meet reasonable expectations. I opened #1833 to track it.

Still can't reproduce the original bug though, so I'm closing this ticket, but feel free to reopen with a link to a project / branch that duplicates it.

On Thu, Feb 28, 2019 at 3:45 PM Alex Bea notifications@github.com wrote:

Having an addFields property in a module extending apos-events seems to break the limitByAll and limitByTag fields.

label: 'Events',

addFields: [

{

  name: 'link',

  label: 'Link',

  type: 'singleton',

  widgetType: 'link'

}

]

};

I'm getting some of the handy new warnings:

⚠️ widget type events, field name by:

showFields for the choice all includes limitByAll, a field that does not exist in the schema

⚠️ widget type events, field name by:

showFields for the choice tag includes limitByTag, a field that does not exist in the schema

Maybe worth double checking apos-blog https://github.com/apostrophecms/apostrophe-blog/blob/master/lib/modules/apostrophe-blog-widgets/index.js ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/apostrophecms/apostrophe-events/issues/38, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB9fdQsmWeE7ntqRQxasyOnHJk0GtJpks5vSD_agaJpZM4bXsxu .

--

Thomas Boutell, Chief Software Architect P'unk Avenue | (215) 755-1330 | punkave.com

boutell commented 5 years ago

Well I won't close it yet... please do link me up to a reproduction of the issue.