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

[5.2] [GSoC 21] Media Manager - Responsive Images final version and "Insert/Edit Image" form improvements #35250

Draft
wants to merge 124 commits into
base: 5.2-dev
Choose a base branch
from

Conversation

eyvazahmadzada
Copy link

@eyvazahmadzada eyvazahmadzada commented Aug 20, 2021

Pull Request for the "Responsive Images and Insert/Edit Image form improvements" task of the final evaluation period of Media Manager.

The final version of #34803.

Summary of Changes

... First PR's changes

  • Improve "Insert/Edit Image" form. While adding an image to the content editors from the media manager, it was possible to add some image details (image description and class, figure caption and class, lazy loading configuration), but there was no option in the “Insert/Edit Image” to change these details thereafter. To improve it, I added extra form controls to the "Advanced" section of the form which allows users to update image details and to customize responsive sizes for any image.

image

  • Improve responsive image size customization. Responsive image size customization forms previously had only 2 fields: width and height. So the sizes didn't have an identifier and images are cropped by a default creation method. To make the functionality fully customizable, I added two additional fields for customizing the image creation method and the size title.

image

image

  • Implement functions to detect unused responsive image versions. I added the functions that compare initial and final versions of web content and detect the images that are not being used anymore. Currently, an alert that contains the names of the images gets popped up, but I’m planning to implement a modal where users can select and remove these images with just a few clicks after GSoC.

image

Testing Instructions

... Follow the same steps as the first PR.

  • Additional instructions. Responsive sizes and image details can be edited by right-clicking on the image -> Image in content editors.

image

Documentation Changes Required

ResponsiveImagesHelper, Image and HTMLHelper class methods must be added or updated.

Special thanks to my mentors (@sebenns, @fancyFranci, @GeraintEdwards, @shivamdiehard, Chris Keen) and @bembelimen for assisting me with the project.

eyvazahmadzada and others added 30 commits June 5, 2021 12:07
Week 1: Generate responsive images
/**
* Test the Image::generateMultipleSizes method without a loaded image.
*
* @return void

This comment was marked as abuse.

*
* @since __DEPLOY_VERSION__
*/
public function testGenerateMultipleSizesWithoutLoadedImage()

This comment was marked as abuse.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you very much for your review @PhilETaylor. Almost all the methods in the Image class have the "return void" as the current version, so wouldn't it be better to replace them in a separate PR?

@brianteeman
Copy link
Contributor

After applying the PR and without doing anything else.

image

Notice
: Undefined property: stdClass::$image_intro_sizes in
C:\htdocs\joomla-cms\layouts\joomla\content\intro_image.php
on line
30


Notice
: Undefined property: stdClass::$image_intro_size_options in
C:\htdocs\joomla-cms\layouts\joomla\content\intro_image.php
on line
30


Notice
: Undefined property: stdClass::$image_intro_method in
C:\htdocs\joomla-cms\layouts\joomla\content\intro_image.php
on line
30


Notice
: Trying to get property 'params' of non-object in
C:\htdocs\joomla-cms\libraries\src\Helper\ResponsiveImagesHelper.php
on line
345


Notice
: Trying to get property 'params' of non-object in
C:\htdocs\joomla-cms\libraries\src\Helper\ResponsiveImagesHelper.php
on line
386

@eyvazahmadzada
Copy link
Author

After applying the PR and without doing anything else.

image

Notice
: Undefined property: stdClass::$image_intro_sizes in
C:\htdocs\joomla-cms\layouts\joomla\content\intro_image.php
on line
30


Notice
: Undefined property: stdClass::$image_intro_size_options in
C:\htdocs\joomla-cms\layouts\joomla\content\intro_image.php
on line
30


Notice
: Undefined property: stdClass::$image_intro_method in
C:\htdocs\joomla-cms\layouts\joomla\content\intro_image.php
on line
30


Notice
: Trying to get property 'params' of non-object in
C:\htdocs\joomla-cms\libraries\src\Helper\ResponsiveImagesHelper.php
on line
345


Notice
: Trying to get property 'params' of non-object in
C:\htdocs\joomla-cms\libraries\src\Helper\ResponsiveImagesHelper.php
on line
386

First I thought that happened because the plugin wasn't installed or activated but then I completely reset my site to default to make sure of that. The weird thing is that this error didn't show up in any case 🤔 Did this appear on the home page?

@eyvazahmadzada eyvazahmadzada marked this pull request as draft August 22, 2021 08:46
@eyvazahmadzada
Copy link
Author

After applying the PR and without doing anything else.

image

Notice
: Undefined property: stdClass::$image_intro_sizes in
C:\htdocs\joomla-cms\layouts\joomla\content\intro_image.php
on line
30


Notice
: Undefined property: stdClass::$image_intro_size_options in
C:\htdocs\joomla-cms\layouts\joomla\content\intro_image.php
on line
30


Notice
: Undefined property: stdClass::$image_intro_method in
C:\htdocs\joomla-cms\layouts\joomla\content\intro_image.php
on line
30


Notice
: Trying to get property 'params' of non-object in
C:\htdocs\joomla-cms\libraries\src\Helper\ResponsiveImagesHelper.php
on line
345


Notice
: Trying to get property 'params' of non-object in
C:\htdocs\joomla-cms\libraries\src\Helper\ResponsiveImagesHelper.php
on line
386

Hi @brianteeman, could you please provide me with the steps to reproduce this issue? I installed Joomla from scratch on my new laptop and still didn't get this error.

@joomla-cms-bot joomla-cms-bot added Unit/System Tests and removed Language Change This is for Translators NPM Resource Changed This Pull Request can't be tested by Patchtester labels Dec 5, 2021
@PhilETaylor

This comment was marked as abuse.

@joomla-cms-bot joomla-cms-bot added Language Change This is for Translators NPM Resource Changed This Pull Request can't be tested by Patchtester and removed Unit/System Tests labels Dec 25, 2021
@HLeithner HLeithner changed the base branch from 4.1-dev to 4.2-dev June 27, 2022 13:07
@HLeithner
Copy link
Member

This pull request has automatically rebased to 4.2-dev.

@Hackwar Hackwar added the Feature label Apr 6, 2023
@HLeithner HLeithner changed the base branch from 4.2-dev to 5.0-dev May 2, 2023 16:43
@HLeithner
Copy link
Member

This pull request has been automatically rebased to 5.0-dev.

@HLeithner HLeithner changed the base branch from 5.0-dev to 5.1-dev September 30, 2023 22:52
@HLeithner
Copy link
Member

This pull request has been automatically rebased to 5.1-dev.

@HLeithner HLeithner changed the base branch from 5.1-dev to 5.2-dev April 24, 2024 09:10
@HLeithner
Copy link
Member

This pull request has been automatically rebased to 5.2-dev.

@HLeithner HLeithner changed the title [4.1] [GSoC 21] Media Manager - Responsive Images final version and "Insert/Edit Image" form improvements [5.2] [GSoC 21] Media Manager - Responsive Images final version and "Insert/Edit Image" form improvements Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Language Change This is for Translators NPM Resource Changed This Pull Request can't be tested by Patchtester PR-5.0-dev PR-5.2-dev
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet