-
Notifications
You must be signed in to change notification settings - Fork 75
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
Switch to ImageBlock #503
base: main
Are you sure you want to change the base?
Switch to ImageBlock #503
Conversation
… to ImageBlock On this site, most images have pretty decent titles so using them while we are converting from ImageChooserBlock to ImageBlock often produces the alt text you likely would have written anyway. Inserting it during the first page save makes this conversion a lot easier for our editors.
…g images to ImageBlock" This reverts commit 305f1f1.
After testing all the blocks where The benefits of implementing the new block outweigh the issue of having the word image appear twice in my opinion. I think implementing this block to improve our alt text is more important. This issue needs to be properly logged and addressed in future versions of Wagtail Core though. |
I've asked @Chiemezuo to rename the migration files so that they better describe the change being made with each migration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All right @Chiemezuo, after doing my initial testing and review, there are a few things that need to be addressed.
As we discussed on the call, it would be really helpful if all the migration files had a more descriptive change to let future maintainers know what changes were made by the migration.
I also found a few instances where ImageChooserBlock was not updated to the new ImageBlock and I would like to know whether those were deliberate choices or whether there were a few instances you missed. If you could go through those and also search the project files for remaining instances that need to be replaced, that would be great.
I am also curious about the update needed to our custom image model. I'd just like to know a bit more about why it's necessary. And we'll want to test this on staging.wagtail.org for sure to make sure any changes to the model don't lead to database problems with our existing images.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume adding this Field to our custom image model is necessary for the alt text? I thought the new ImageBlock was interchangeable with ImageChooserBlock, so I'm just curious why this change is necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename this migration file to be more descriptive. Something like 0014_add_new_imageblock.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename this migration file to be more descriptive. Something like 0014_add_new_imageblock.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename this migration file to be more descriptive. Something like 0014_add_new_imageblock.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename this migration file to be more descriptive. Something like 0014_add_new_imageblock.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename this migration file to be more descriptive. Something like 0014_add_new_imageblock.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there is an instance of ImageChooserBlock left in this file that wasn't replaced by the new ImageBlock. Did you not change it because it wasn't changed in the prior PR @Chiemezuo? Or do you have another reason for leaving it be?
See line 109 in the LogoCardBlock.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also looks like there is another instance of ImageChooserBlock in line 463 in LogoBlock.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there is another instance of ImageChooserBlock on Line 22 under CardBlock. Is there a reason we're not changing this one? If not, we should probably see if the new ImageBlock works well here.
This is a follow-up to #480
I removed the patch (and the resulting older migrations) as the issues it addressed were fixed in Wagtail 6.4.
I also rebased so I could preserve the commit authors and their history, with a few additions.