This module will provide zoom functionality for images.

Project link

https://www.drupal.org/project/zoomnow

Issue fork dbc-3428600

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

  • 3428600-dbc2.1.x Comparecompare

Comments

joshi88 created an issue. See original summary.

joshi88’s picture

Status: Needs review » Active
Issue tags: -PAreview: review bonus, -PAreview: security +Security
joshi88’s picture

Issue summary: View changes
joshi88’s picture

Title: dbc:2.1.x » [2.1.x] Domain Base Css
Project: Domain Base Css » Drupal.org security advisory coverage applications
Version: 2.1.x-dev »
Component: Miscellaneous » module
Issue summary: View changes
avpaderno’s picture

Issue tags: -Security

Thank 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.

  • If you have not done it yet, you should run phpcs --standard=Drupal,DrupalPractice on the project, which alone fixes most of what reviewers would report.
  • For the time this application is open, only your commits are allowed.
  • The purpose of this application is giving you a new drupal.org role that allows you to opt projects into security advisory coverage, either projects you already created, or projects you will create. The project status will not be changed by this application; no other user will be able to opt projects into security advisory policy.
  • We only accept an application per user. If you change your mind about the project to use for this application, or it is necessary to use a different project for the application, please update the issue summary with the link to the correct project and the issue title with the branch to review and the project name.

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.

  • It is preferable to wait for a Code Review Administrator before commenting on newly created applications, even to leave a comment similar to the following one. Code Review Administrators will do some preliminary checks that are necessary before any change on the project files is suggested.
  • It is also preferable to wait before using a CLI tool to report what needs to be changed, especially because the comment left from Code Review Administrators suggests to use PHP_CodeSniffer. Before that, manual reviews should be done.
  • Reviewers should not copy-paste the output of a CLI tool. They should use a CLI tool only once per application. When they do that, they should later verify the code has been correctly changed; this means, for example, that adding a documentation comment that is not correct just to avoid to get a warning/error is not a correct change that should be reported in a further comment.
  • It may be best to have the applicant fix things before further review.

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.

joshi88’s picture

I have already run --phpcs command..

vishal.kadam’s picture

Remember to change status, when the project is ready to be reviewed. In this queue, projects are only reviewed when the status is Needs review.

joshi88’s picture

Status: Active » Needs review
vishal.kadam’s picture

Status: Needs review » Needs work

Usually, 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 a developer.

Have you made any other contributions that we could instead review?

joshi88’s picture

No @vishal.Its my first contribution For Drupal 10.

joshi88’s picture

@vishal What I need to do?

vishal.kadam’s picture

This application can only continue with another project that contains sufficient PHP code.

joshi88’s picture

#9, @vishal I had worked on Drupal 7 project.
https://www.drupal.org/project/zoomnow Please have a look.

avpaderno’s picture

Title: [2.1.x] Domain Base Css » [7.x-1.x] zoomnow
Issue summary: View changes
Status: Needs work » Needs review
joshi88’s picture

@apaderno I am working on Domain Base Css Project.

avpaderno’s picture

That project cannot be used for these applications, as comments #9 and #12 said.

joshi88’s picture

@Vishal Please review it.. Please guide me What I need to do, if still its not eligible.

vishal.kadam’s picture

Status: Needs review » Needs work

1. FILE: zoomnow.module

/**
 * @file
 * Adds a formatter for zoomnow.
 */

The description for a module is Hook implementations for the [module name] module. where [module name] is the module name given in the .info.yml file.

function zoomnow_field_formatter_settings_form(
  $field,
  $instance,
  $view_mode,
  $form,
  &$form_state
) {
function zoomnow_field_formatter_settings_summary(
  $field,
  $instance,
  $view_mode
) {
function zoomnow_field_formatter_view(
  $entity_type,
  $entity,
  $field,
  $instance,
  $langcode,
  $items,
  $display
) {

Function and method declarations are written on a single line.

2. FILE: zoomnow.js

//var fetchOptions = Drupal.settings['zoomnow_selected_option']['zoomnow_option_selected'];

Remove commented code.

joshi88’s picture

Hi @vishal I have removed unwanted comment from zoomnow.js file.
Module name in zoomnow.info file:

name = ZoomNow
description = will show zoom functionality on images.
package = Zoom
core = "7.x"
configure = admin/config/user-interface/zoomnow
dependencies[] = jquery_update
joshi88’s picture

Status: Needs work » Needs review
vishal.kadam’s picture

Status: Needs review » Needs work

Module file changes are still pending. Please see point 1 in my Comment #17.

avpaderno’s picture

  • The following points are just a start and don't necessarily encompass all of the changes that may be necessary
  • A specific point may just be an example and may apply in other places
  • A review is about code that doesn't follow the coding standards, contains possible security issue, or does not correctly use the Drupal API; the single points are not ordered, not even by importance

zoomnow.module

/**
 * @file
 * Adds a formatter for zoomnow.
 */

The usual description for a .module file is Hook implementations for the [module name] module. where [module name] is the name of the module reported in its .info file.

/**
 * Implements hook_field_formatter_settings_summary().
 */
function zoomnow_field_formatter_settings_summary(
  $field,
  $instance,
  $view_mode
) {

Drupal coding standards says function declarations are written on a single line, even if they exceed 80 characters.

/**
 * Implements zoomnow_zoomfunction_form().
 */
function zoomnow_zoomfunction_form($form, &$form_state) {
  $form = array();
  $opt = array('hover' => t('hover'), 'click_active' => t('Click on active'));
  $form['selected_option']['zoomnow_option_selected'] = array(
    '#type'          => 'radios',
    '#title'         => t('Zoom Plugin options'),
    '#options'       => $opt,
    '#default_value' => variable_get('zoomnow_option_selected', 'hover'),
    '#required'      => TRUE,
  );

  return system_settings_form($form);
}

That is not a hook implementation but a form builder. Its documentation comment must be different.

zoomsnow.tpl.php

drupal_add_css(drupal_get_path('module', 'zoomnow') . '/zoomnow.css');
drupal_add_js(drupal_get_path('module', 'zoomnow') . '/jquery.zoom.min.js');
drupal_add_js(drupal_get_path('module', 'zoomnow') . '/zoomnow.js');

It's quite too late, to add JavaScript files from a template file. They can be added with #attached in a function that returns a render array.

joshi88’s picture

Status: Needs work » Needs review
joshi88’s picture

I have fixed above errors.. Please have a look.

joshi88’s picture

HI @apaderno have you got the chance to review it.

joshi88’s picture

@vishal have you got a chance to review it..

vishal.kadam’s picture

Status: Needs review » Needs work

I have reviewed your changes. I can see that not all feedback from comment #22 has been addressed. Please double-check.

joshi88’s picture

Status: Needs work » Needs review

@vishal I have fixed. Please have a look when you will get a chance.

joshi88’s picture

HI Vishal.. Please also guide me for my D10 project.. You had mentioned on #9.

vishal.kadam’s picture

Rest looks fine to me.

Let’s wait for a Code Review Administrator to take a look and if everything goes fine, you will get the role.

joshi88’s picture

Thanks @Vishal.

vishal.kadam’s picture

Status: Needs review » Reviewed & tested by the community
joshi88’s picture

@Vishal. Please guide me what would be my next step..

vishal.kadam’s picture

Wait for the final review from a Code Review Administrator.

joshi88’s picture

Ok..

joshi88’s picture

Hi Vishal . Do you have any rough idea, that how long will it take to final review. Because my d10 module depend on this. Once it will be approve then you will consider d10 project…

cmlara’s picture

@joshi88: I suggest you re-read comment #5 it includes details about timelines.

There are many applications in the queue that have waited longer than yours have and you have not taken any of the steps available to accelerate your application documented in the application process.

It is important to note that Security Coverage is not required to publish modules.

Security coverage means:

  • You as a maintainer promise the community to fix security issues (you can do this without having the opt-in permission)
  • The Drupal Association/Drupal.org website will no longer encourage uncoordinated public disclosure of vulnerabilities (this is an ethics issue on its own)
  • The public might report vulnerability privately (even security covered modules may often find public reports)
  • That the Drupal security team might remove public posts on D.O. regarding the issue to allow time to for private resolution. The security team is under no obligation to remove posts and may choose not to at their leisure. (GitLab Issues conversion may help this as module maintainers may be able to mark their own issues as private)
  • Users of your module might get notified through an SA and composer that security bugs exist. (The DST does not publish all security vulnerabilities)
avpaderno’s picture

Status: Reviewed & tested by the community » Needs work

zoomnow.module

/**
 * Implements hook_init().
 */
function zoomnow_init() {
  // Add CSS file.
  drupal_add_css(drupal_get_path('module', 'zoomnow') . '/zoomnow.css');

  // Add JavaScript files.
  drupal_add_js(drupal_get_path('module', 'zoomnow') . '/jquery.zoom.min.js');
  drupal_add_js(drupal_get_path('module', 'zoomnow') . '/zoomnow.js');
}

My previous comment suggested to use #attached in a function that returns a render array. It meant to use #attached in the function that calls theme('zoomnow_images', $variables).

function zoomnow_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
  $element = array();

  if ($display['type'] == 'zoomnow_formatter') {
    $element['#attached']['css'] = array(
      drupal_get_path('module', 'zoomnow') . '/zoomnow.css',
    );
    $element['#attached']['js'] = array(
      drupal_get_path('module', 'zoomnow') . '/jquery.zoom.min.js',
      drupal_get_path('module', 'zoomnow') . '/zoomnow.js',
    );

    foreach ($items as $delta => $item) {
      $variables = array(
        'file' => $item,
      );

      $element[$delta] = array(
        '#markup' => theme('zoomnow_images', $variables),
      );

    }
  }

  return $element;
}
  $items['admin/config/user-interface/zoomnow'] = array(
    'title'            => t('ZoomNow'),
    'description'      => t('Manage the ZoomNow settings.'),
    'page callback'    => 'drupal_get_form',
    'page arguments'   => array('zoomnow_zoom_settings_form'),
    'access arguments' => array('administer zoomnow'),
    'type'             => MENU_NORMAL_ITEM,
  );

Title and description musts be untranslated strings. They are passed to the title callback, which by default is t().

/**
 * Implements hook_form().
 */
function zoomnow_zoom_settings_form($form, &$form_state) {
  $form = array();
  $opt = array('hover' => t('Hover'), 'click_active' => t('Click on active'));
  $form['selected_option']['zoomnow_option_selected'] = array(
    '#type' => 'radios',
    '#title' => t('Zoom Plugin options'),
    '#options' => $opt,
    '#default_value' => variable_get('zoomnow_option_selected', 'hover'),
    '#required' => TRUE,
  );

  return system_settings_form($form);
}

That function is not a hook_form() implementation.

$form must not be initialized to an empty array. A form builder just adds form elements to the $form argument it receives. See aggregator_form_category(), for example.

function aggregator_form_category($form, &$form_state, $edit = array('title' => '', 'description' => '', 'cid' => NULL)) {
    $form['title'] = array(
        '#type' => 'textfield',
        '#title' => t('Title'),
        '#default_value' => $edit['title'],
        '#maxlength' => 64,
        '#required' => TRUE,
    );
    $form['description'] = array(
        '#type' => 'textarea',
        '#title' => t('Description'),
        '#default_value' => $edit['description'],
    );
    $form['actions'] = array(
        '#type' => 'actions',
    );
    $form['actions']['submit'] = array(
        '#type' => 'submit',
        '#value' => t('Save'),
    );
    if ($edit['cid']) {
        $form['actions']['delete'] = array(
            '#type' => 'submit',
            '#value' => t('Delete'),
        );
        $form['cid'] = array(
            '#type' => 'hidden',
            '#value' => $edit['cid'],
        );
    }
    return $form;
}

jquery.zoom.js

jquery.zoom.min.js

Files available in other repositories should not be committed on drupal.org repositories. Instead, people installing the module should get instructions on how to obtain those files.

zoomnow.js

(function ($) {
  'use strict';
  Drupal.behaviors.zoomnow = {
    attach: function (context, settings) {
      var fetchOptions = Drupal.settings.zoomnow_selected_option.zoomnow_option_selected;
      if (fetchOptions === 'hover') {
        $('.zoomnow').zoom();
      }
      if (fetchOptions === 'click_active') {
        $('.zoomnow').zoom({on: 'click'});
      }
    }
  };

})(jQuery);

To avoid a behavior is attached twice to the same CSS selector, $('.zoomnow', context).once() must be used.

README.txt

Since the file has been committed, it should also follow closely the structure described in README.md template (and use .md as extension).

The project description needs to be more detailed; it should also make clear in which way the module is different from modules like Zooming (and other modules that can be found by searching for zoom).

avpaderno’s picture

vishal.kadam’s picture

Priority: Normal » Minor

I am changing priority as per Issue priorities.

vishal.kadam’s picture

Status: Needs work » Closed (won't fix)

This 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.

avpaderno’s picture

Status: Closed (won't fix) » Needs work
joshi88’s picture

Status: Needs work » Needs review
avpaderno’s picture

Status: Needs review » Needs work

The code has not been changed following my previous #38 comment.

joshi88’s picture

Status: Needs work » Needs review

I have done required changes.

joshi88’s picture

Hi avpaderno
please let me know is anything need to be done from my side..

Thanks

avpaderno’s picture

Priority: Minor » Normal
Status: Needs review » Reviewed & tested by the community

Thank you for your contribution and for your patience with the review process!

I am going to update your account so you can opt into security advisory coverage any project you create, including the projects you already created.

These are some recommended readings to help you with maintainership:

You can find more contributors chatting on Slack or IRC in #drupal-contribute. So, come hang out and stay involved!
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

I thank also all the reviewers for helping with these applications.

avpaderno’s picture

Status: Reviewed & tested by the community » Fixed
joshi88’s picture

Thanks avpaderno. Now what would be my next step on this project ..

avpaderno’s picture

You need to change the value for Security advisory coverage shown on https://www.drupal.org/node/2554939/edit.

joshi88’s picture

Hi .
I am unable to push. Getting this error
git push origin 7.x-1.x
fatal: unable to access 'https://git.drupalcode.org/project/zoomnow.git/': The requested URL returned error: 500

avpaderno’s picture

These applications just allow editing project pages as I described in my previous comment. They do not change how committers are authenticated on git.drupalcode.org.

Verify Git has been set to use the same SSH key added on https://git.drupalcode.org/-/user_settings/ssh_keys. Furthermore, to associate the commits to https://git.drupalcode.org/joshi88, Git must be set to one of the emails added on https://git.drupalcode.org/-/profile/emails.

joshi88’s picture

Thanks.. I have done this.. Now what I need to do, to move this project sandbox to full project.

avpaderno’s picture

It is already a full project: Only full projects have URLs like https://www.drupal.org/project/zoomnow; sandbox projects would have a URL similar to https://www.drupal.org/sandbox/shawngo/1360698.

joshi88’s picture

StatusFileSize
new83.11 KB

ok. But not getting the option download the module like other projects.

bbu23’s picture

StatusFileSize
new45.45 KB

@joshi88 You're probably looking for the "Administer releases" page (linked in the bottom of the project page).

Administer releases

joshi88’s picture

Thanks @bbu23.. I have done this.. Any idea, how long will it take to reflect on project page...

bbu23’s picture

@joshi88 In the Administer Releases page, only the releases that are marked as supported are displayed on the project page. Did you double check the Administer releases page if everything is in order?

avpaderno’s picture

That is correct: Without releases (including development versions), no download link is available. Releases for that project are created on https://www.drupal.org/node/add/project-release/2554939.

avpaderno’s picture

Furthermore, on https://www.drupal.org/node/2554939/edit/releases, the page that allows selecting which release is supported, no 7.x release is shown. Probably, when a release name starts with 7.x, no download link is shown.

I cannot say if that happens for all the Drupal 7 releases.

avpaderno’s picture

The documentation on creating project releases is Creating a project release, which does not document what happens when a release is only compatible with a Drupal version that is no longer supported.

joshi88’s picture

Thanks Folks..

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.