What will this module do?
This module will take images the were uploaded via the wysiwyg and attach them to an image field.
Why?
This will allow the user to use images that were placed in the WYSIWYG in a photo gallery, teaser image, or any other way that fieldable images are commonly used.
Steps to configure
1. Enable the module
2. Go the the modules configuration page (/admin/config/content/image-attach)
3. Set whichever fields to use for each content type
Other Notes
1. This currently only applies to the 'Node' entity type
Project Page
https://www.drupal.org/project/inline_image_attach
Git Clone
git clone --branch 8.x-1.0 https://git.drupal.org/project/inline_image_attach.git
Comments
Comment #2
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxMirakolous2668454git
We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #3
mirakolous commentedI did already check these, thank you!
Comment #4
flocondetoileEdit : the pareview.sh errors reported are not fixed
Testing
- Configuration : you should provide a link to the module’s configuration in the .info.yml
- All the content type are not listed in the configuration form (The basic page has a body field and a image field but is not listed in the configuration form)
- On a fresh drupal 8.0.3 install, I’ve got this error when configuring the content type article
Warning: Missing argument 1 for Drupal\Core\Form\FormState::getValue(), called in /srv/www/drupal8/modules/inline_image_attach/src/Form/InlineImageAttachForm.php on line 84 and defined in Drupal\Core\Form\FormState->getValue() (line988 of core/lib/Drupal/Core/Form/FormState.php).When saving an article, after include an inline image
Warning: Missing argument 2 for inline_image_attach_entity_presave() in inline_image_attach_entity_presave() (line 6 of modules/inline_image_attach/inline_image_attach.module).Otherwise the image was well injected in the field field_image.
But the alt attribute is not populated. As by default alt attributes is required, and it’s best practice to fill it, it would be nice to handle this behavior. You could use at least the filename.
Features
It's a common use case to customize folder which store images. Would be more relevant to use the path configured in the wysiwg settings instead of to hardcode this path (inline-image) in your module.
Manual review
1- inline_attach_image.routing.yml
The administration menu callback should probably use "administer inline attach image" - which implies the user can change something - rather than "access administration pages" which is about viewing but not changing configurations.
2- inline_image_attach.module
- PHPDocs not relevant (Implants hook_theme() wheres it’s hook_entity_presave)
- The correct implementation of hook_entity_presave is hook_entity_presave(Drupal\Core\Entity\EntityInterface $entity)
- For testing the entity type, you should use if $entity Instanceof …. instead of if $type_id == "node"
3- InlineImageAttachForm.php
You use deprecated function :
You should not call the service \Drupal::entityManager() inside your class but should use dependency injection if you want in the futur do automated tests
The $form_state->getValue() method require a $key parameter. you should use $form_state->getValues() instead.
Comment #5
klausiThe wrong permission is a security issue. And please don't remove the security tag, we keep that for statistics and to show examples of security problems.
Comment #6
PA robot commentedClosing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #7
mirakolous commentedThis is ready for another round of reviews.
Fixes in latest revision:
- Config link added to info.yml
- Fix to content type machine name to grab all content types
- using getValues() so no argument needed
- Removing $type argument from hook_entity_presave which does not exist in D8
- Now grabbing path configured in the wysiwg settings for inline images folder
- Adding administer permission
- PHPDocs relevancy fix
- Using InstanceOf to determine $entity type
- Adjusted Config factory to use dependency injection
Won't fix (for now):
- deprecated functions
Can't fix:
- Setting Alt text. Right now, users are forced to add alt text next time they edit the node. I can query the inline image to get its alt text, but I can not figure out how to set the alt text in entity presave. I do not think this is a blocker but something that we would like to incorporate when possible.
Comment #8
mirakolous commentedComment #9
mirakolous commentedComment #10
avpadernoTo the reviewers: Please change back the priority to Normal after doing a review.
Comment #11
sleitner commentedAutomated Review
pareview details see https://pareview.sh/pareview/https-git.drupal.org-project-inline_image_a...
Git errors:
Review of the 8.x-1.x branch (commit 208f119):
hook_help().This automated report was generated with PAReview.sh, your friendly project application review script.
Manual Review
If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.
This review uses the Project Application Review Template.
Comment #12
sleitner commentedComment #13
avpadernoIf you are still working on this application, you should fix all known problems and set the status to Needs review. (See also the project application workflow.)
Please don't change status of this application if you aren't sure you have time to dedicate to this application, or it will be closed again as won't fix.
I am closing this application due to lack of activity.