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

[WIP] - Fix location accessor #16

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

[WIP] - Fix location accessor #16

wants to merge 9 commits into from

Conversation

cekk
Copy link
Contributor

@cekk cekk commented Jun 23, 2019

Location accessor for events didn't return the default "location" field value, if set.

Now the accessor looks for venue field, and if not set, looks into the default location field.

I've also added a test for this feature and setup travis conf.

@cekk cekk requested review from thet and petschki June 23, 2019 09:18
Copy link
Member

@petschki petschki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but @thet is the maintainer and I hardly ever used c.venue before...

@cekk
Copy link
Contributor Author

cekk commented Jul 9, 2019

@thet i've found two problems:

  • behavior fields for reference a location and an organizer were not correctly serialized by plone.restapi. I switched them to be real relation fields and changed their names.
  • Control panel breaks on save. This happens also on a Plone 5.1.5. Is it really used? Can we remove it and all defaults?

These two problems are related to p.a.vocabularies. The first one happens only with newer p.a.vocabulary and restapi because i think that something has changed in CatalogVocabulary.

Are these changes ok for you?

@cekk cekk changed the title Fix location accessor [WIP] - Fix location accessor Jul 9, 2019
@cekk
Copy link
Contributor Author

cekk commented Jul 9, 2019

Another thing: i've made an upgrade-step to fix old fields, but it doesn't show up in products control panel (maybe because there are different profiles).

From portal_setup everything works well

@cekk
Copy link
Contributor Author

cekk commented Jul 10, 2020

@thet any news about this pr?

Copy link
Member

@thet thet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Thanks for the PR. Although it seems we're loosing the default value for IVenue and IOrganizer schema and also we probably need some work to get location references from other subsites in a Lineage subsite working, I'm OK with this PR.

Sorry for the very late review!

title=_(u'label_event_location', default=u'Location'),
description=_(
u'description_event_location', default=u'Select a location.'
),
required=False,
missing_value='',
defaultFactory=default_location,
# defaultFactory=default_location,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why no default_location? the idea behind this was that some organizers have their events most always in the same location and with the overridable default location it can be pre-set.

pattern_options={
'selectableTypes': ['Venue'],
'basePath': get_base_path,
# 'basePath': get_base_path,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the idea behind the basePath was to allow access to venues outside the current plone site, e.g. if you're in a lineage subsite of another parent site and want to have access to the "address book" of that parent site.

but the catalog on the other hand looks much more convenient. you don't have to browse to the venues then, right?

title=_(u'label_event_organizer', default=u'Organizer'),
description=_(
u'description_event_organizer', default=u'Select an organizer.'
),
required=False,
missing_value='',
defaultFactory=default_organizer,
# defaultFactory=default_organizer,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here like above

vocabulary='plone.app.vocabularies.Catalog',
)
form.widget(
'organizer_uid',
'organizer_ref',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we use the vocabulary in the IVenue for the location_ref, shouldn'd we also use the vocabulary here?

@@ -143,7 +143,15 @@
handler="collective.venue.upgrades.upgrade_registry"
profile="collective.venue:base"
/>


<genericsetup:upgradeStep
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bonus points for the upgrade step! (thanks ;) )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants