Closed (won't fix)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
14 May 2024 at 06:54 UTC
Updated:
4 Sep 2025 at 23:07 UTC
Jump to comment: Most recent
Comments
Comment #2
vishal.kadamThank you for applying!
Please read Review process for security advisory coverage: What to expect for more details and Security advisory coverage application checklist to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smoother review.
The important notes are the following.
phpcs --standard=Drupal,DrupalPracticeon the project, which alone fixes most of what reviewers would report.To the reviewers
Please read How to review security advisory coverage applications, Application workflow, What to cover in an application review, and Tools to use for reviews.
The important notes are the following.
For new reviewers, I would also suggest to first read In which way the issue queue for coverage applications is different from other project queues.
Comment #3
vishal.kadamComment #4
avpadernoUsually, after reviewing a project, we allow the developer to opt projects into security advisory coverage. This project is too small for us and it doesn't contain enough PHP code to really assess your skills as developer.
Have you created any other project on drupal.org (module, theme, distribution) we could instead review? The project needs to have most of the commits (preferable all the commits) done by you.
Actually, I do not even see the code that should handle the features described in the issue summary.
Comment #5
harwinder commentedHi @all
I modified my PHP code in my module according to your suggestion. Could you please take a look and review it?
Comment #6
rushikesh raval commentedPlease refer comment #4
Comment #7
rushikesh raval commentedComment #8
avpadernoNow the project has enough PHP code. There is something that needs to be changed in that code, but at least there is enough PHP code, now.
Comment #9
vishal.kadam1. Fix phpcs issues.
2. FILE: personality_test.module
The usual description for a .module file is Hook implementations for the [module name] module. where [module name] is the module name given in the .info.yml file.
3. FILE: templates/personality-test-quiz.html.twig
Move all scripts (JavaScript) and styles (CSS) into a library and attach them. See the process here.
Comment #10
avpadernopersonality_test.info.yml
There is no need to say Drupal module, since all the modules hosted on drupal.org are for Drupal.
personality_test.install
Every function must be a name that is prefixed by the module machine name, to avoid conflicts with other modules.
In Drupal, modules that define a new content type do not delete the nodes of that content type, nor the content type.
personality_test.module
Drupal does not have primary and secondary hooks. Instead of that, it is preferable to use the usual description: Hook implementations for the [module name] module. where [module name] is the name of the module given in its .info.yml file.
The description is not for this module, since it does not provide any custom error display functionality.
src/Controller/PersonalityTestController.php
Those tags are not used in Drupal, and their content is placeholder content.
@sinceis not correct, since that class is not a PHP class and it cannot be said to exist starting from PHP 7.4.Drupal controller classes do not add blocks to the page.
if ($request->getMethod() === 'POST') {The controller renders a template file, which cannot be used to POST data. to gather information from users, a form must be used. (Drupal is not WordPress; it has a form API which must be used to gather information.)
It is not clear why the controller creates a new node (without checking it already exists), which not even shown in someway to the users.
src/Plugin/Block/PersonalityTestQuizBlock.php
\is not a correct return type. Furthermore, it is not necessary to use@return, with{@inheritdoc}.src/Options.php
Instead of using a class with a static method, which is used from a single class, it would be better to incorporate that method in the class using it.
templates/personality-test-quiz.html.twig
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>Drupal already comes with the jQuery library. That is not the correct way to use the jQuery library in a page or a template file.
I do not see any code that helps figure out what kind of person you are. It seems this module is "work in progress."
Comment #11
harwinder commentedHi @all
I've made changes to my module based on your suggestions. I've included the link to my repository below. Could you please review it?
Repository Link:-
git@git.drupal.org:project/personality_assessment_test.git
Branch Name:-
1.0.x
Commit Link
https://git.drupalcode.org/project/personality_assessment_test/-/commit/...
Previous Issue Comment
#. It is not clear why the controller creates a new node (without checking it already exists), which is not even shown in some way to the users.
Comment:: I did not delete the previous node because I needed to back up the previous user results. Therefore, after completing the assessment, a new node is created.
#. I do not see any code that helps figure out what kind of person you are. It seems this module is a "work in progress."
Comment:: It helps figure out to users understand their personality traits. This assessment evaluates various aspects of a user's personality and provides a detailed report based on the results.
Comment #12
harwinder commentedComment #13
avpadernoThe description of the module given in its README.md file is the following. (Emphasis is mine.)
> This module helps figure out what kind of person you are. It usually has a bunch of questions for you to answer. After you finish, it gives you a report that explains your personality traits, like if you're outgoing or shy, organized or laid-back, and so on.
In Drupal, the correct way to ask for information to users is via a form. The module does not implement any form.
The correct way to show information based on what entered in a form is via the form submission handler. The module does not have any form submission handler. Furthermore, I do not see any code that would tell the users they are shy, laid-back, etc.
A controller does not need any block to show information via a template file. a Controller class can output directly a render array, which (via
#theme) can also use a template file.Furthermore, a template file is not the place to process what entered from users.
Comment #14
harwinder commentedHi @all
Previous Issue Comment
#. The description of the module given in its README.md file is the following. (Emphasis is mine.)
> This module helps figure out what kind of person you are. It usually has a bunch of questions for you to answer. After you finish, it gives you a report that explains your personality traits, like if you're outgoing or shy, organized or laid-back, and so on.
Furthermore, I do not see any code that would tell the users they are shy, laid-back, etc.
Comment::
This module is currently designed to help users gain insight into their personality traits. Through a series of questions, users can complete a test that assesses their Dominance (D), Influence (I), Steadiness (S), and Conscientiousness (C) traits. Once the test is completed, users receive a detailed report indicating the percentage of each trait they possess. This information is then saved in their node with the content type "Personality Assessment Test," allowing them to reference and track their results over time.
I've made changes to my README.md & controller file. I will update the description of README.md as my module will work currently. Could you please review it?
#. In Drupal, the correct way to ask for information from users is via a form. The module does not implement any form.
The correct way to show information based on what is entered in a form is via the form submission handler. The module does not have any form submission handler.
Comment:: This module does not include any form because JavaScript is used to display questions on the page through a block. As a result, there's no need for a form in this module.
Repository Link:-
git@git.drupal.org:project/personality_assessment_test.git
Branch Name:-
1.0.x
Commit Link
https://git.drupalcode.org/project/personality_assessment_test/-/commit/...
Comment #15
harwinder commentedComment #16
avpadernoIn Drupal, the correct way to ask information to users is using the form API, and the correct way to store the entered information is using the database API, not creating a new node every time a user visit the controller page.
A controller shows its output directly because on Drupal the blocks shown on a page are decided from the site settings. This means that a block a module expects to be seen in the page it returns could not be visible.
Comment #17
vishal.kadamI am changing priority as per Issue priorities.
Comment #18
vishal.kadamThis thread has been idle, in the Needs work state with no activity for several months. Therefore, I am assuming that you are no longer pursuing this application, and I marked it as Closed (won't fix).
If this is incorrect, and you are still pursuing this application, then please feel free to re-open it and set the issue status to Needs work or Needs review, depending on the current status of your code.
Comment #19
avpadernoComment #20
avpadernoThis thread has been idle, in the Needs work state with no activity for more than eight months; the application has been created more than 11 months ago. Therefore, I marked it as Closed (won't fix).
If this is incorrect, and you are still pursuing this application, please feel free to re-open it and set the issue status to Needs work or Needs review, depending on the current status of your code.