Using drush command to download CKEditor library returns a warning message with "Undefined offset".

Warning message:

$ drush ckeditor-download
Undefined offset: 0 ckeditor.drush.inc:46

Steps to reproduce the issue:

  1. Install Drush command
  2. Install CKEditor module
  3. Clear the drush cache with drush cc drush
  4. Run the drush command to download CKEditor library: drush ckeditor-download

Versions:

  • CKEditor: 7.x-dev
  • Drush: 8.1.3
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hgoto created an issue. See original summary.

hgoto’s picture

Status: Active » Needs review
Issue tags: +Novice

I created a patch for this. The point is just one line.

--- a/includes/ckeditor.drush.inc
+++ b/includes/ckeditor.drush.inc
@@ -43,7 +43,7 @@ function ckeditor_drush_command() {
  */
 function ckeditor_drush_download() {
   $args = func_get_args();
-  if ($args[0]) {
+  if (!empty($args[0])) {
     $path = $args[0];
   }
   else {

I'd like someone to review this. Thank you in advance.

hgoto’s picture

hgoto’s picture

Title: drush ckeditor-download raise warning for undefined offset » drush ckeditor-download command raises warning with undefined offset

Improved the title.

Kenedy Maneiro’s picture

Assigned: Unassigned » Kenedy Maneiro
Kenedy Maneiro’s picture

Assigned: Kenedy Maneiro » Unassigned
jcisio’s picture

Status: Needs review » Reviewed & tested by the community

  • jcisio committed 9ea879b on 7.x-1.x authored by hgoto
    Issue #2795603 by hgoto: drush ckeditor-download command raises warning...
jcisio’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed. Thank you.

hgoto’s picture

@jcisio thank you!

Status: Fixed » Closed (fixed)

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