-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Front-end reordering issue of orderables in Wagtail 4.0 & 4.0.1 #9145
Comments
The issue is the use of https://api.jquery.com/children/ no longer working with the new DOM structure introduced by #8983 / ca7f23d However, the fix may need to be carefully done as to not break nested inline panels.
What is happening here is it is finding the Maybe we can move the inputs up? update - this will not work due to the panel component usage. We should really pull this code out to its own file and add unit tests for this code as it is quite fragile. |
- fixes wagtail#9145 - no longer working with the new DOM structure introduced by wagtail#8983 / ca7f23d - instead of using `$.children` use `$.find` to find the panel's input fields but ensure we still supported nested fields by finding based on the child panel's id
- fixes wagtail#9145 - no longer working with the new DOM structure introduced by wagtail#8983 / ca7f23d - instead of using `$.children` use `$.find` to find the panel's input fields but ensure we still supported nested fields by finding based on the child panel's id
I still have this issue in 4.1.2 ... basic inline model: class CarouselImages(Orderable):
"""Between 1 and 5 images for the home page carousel."""
page = ParentalKey("blog.BlogPage", related_name="carousel_images")
carousel_image = models.ForeignKey(
"wagtailimages.Image",
null=True,
blank=False,
on_delete=models.SET_NULL,
related_name="+",
verbose_name="Image"
)
caption = RichTextField(null=True, blank=True)
panels = [FieldPanel("carousel_image"), FieldPanel("caption")]
class Meta:
verbose_name = 'Carousel Image' content_panels = Page.content_panels + [
MultiFieldPanel(
[InlinePanel("carousel_images", max_num=5, min_num=1)],
heading="Carousel Images",
), |
@enzedonline Your |
@gasman ha, thanks ... I'm wondering how I haven't come across that before now ... ;) |
Issue Summary
After upgrading to Wagtail > 4.0 the admin frontend stopped saving the push-up and push-down reordering of orderables referenced through an inline-panel. The UI responds correctly by moving the orderables up and down, but the state is neither saved once the post is published — nor is the changing of the sort order reflected in the live preview.
Steps to Reproduce
wagtail start myproject
and made a test.The result is the following: In the admin panel I am able to create new collection pages and choose collection items that consist of Wagtail images. Once I have established the parentally-relations they are not reorderable. The move up and down in UI and when I publish the post, the changes in order are not saved. Neither are the changes reflected in the live preview panel.
Yes!
Technical details
Follow up
The text was updated successfully, but these errors were encountered: