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

fix(Buckets): save featured type using morph map instead of module name #2536

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from

Conversation

Tofandel
Copy link
Contributor

@Tofandel Tofandel commented Mar 12, 2024

Description

Currently when using the bucket feature, the morphMap has to match exactly the name of the twill module, this is very restrictive especially in projects where the morphMap was already defined, because the featured_type column is saved using the module name instead of the MorphMap of the class

This effectively results in a fatal error when loading the Feature because the Morph fails

This PR aims to fix this issue by correctly saving the Feature using the morph map

It also fixes the label displayed here to be taken from the bucketable config rather than the current behavior of ucfirst the module name on reload
image
And it improves the performance of the bucket controller which currently loads all of the repositories in any case even though only one is ever displayed at a time, it now only loads the first one or the requested one

Also added a documented 'repository' option for bucketables to allow passing the repository class directly (or it cannot work with Package capsules)

PS: it would also be a nice addition to buckets to add an option to edit the featured model either clicking on the title or with an edit button somewhere here
image

Improve buckets doc
@Tofandel Tofandel changed the title fix(Buckets): Save feature type using morph map fix(Buckets): save feature type using morph map Mar 12, 2024
@Tofandel Tofandel changed the title fix(Buckets): save feature type using morph map fix(Buckets): save feature type using morph map instead of module name Mar 12, 2024
@Tofandel Tofandel changed the title fix(Buckets): save feature type using morph map instead of module name fix(Buckets): save featured type using morph map instead of module name Mar 12, 2024
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

1 participant