In running updates on a site, I started seeing errors after update to Views Slideshow 7.x-3.3. The dialog, seen when going to admin/modules, listed Fatal error: Argument 2 passed to t() must be an array, pointing to Slideshow cycle.

To be sure it wasn't a jQuery issue, I installed and enabled the jQuery Update module, and toggled different versions, but no effect.

So, I reverted back to 7.x-3.2, and no issues, indicating a module bug. Further checks after reverting showed no anomalies.

Comments

karolus created an issue. See original summary.

nickdickinsonwilde’s picture

Hmm that is annoying - mostly because I can't replicate the error - either before release or right now.
Any chance of a line number from the error message?
Thanks for reporting.

bredy73’s picture

I have the same problem

bredy73’s picture

Notice: Undefined variable: css_id in include() (linea 16 di /home/anasanvi/public_html/sites/all/modules/views_slideshow/theme/views-slideshow-pager-field-field.tpl.php).
Notice: Undefined variable: field_item in include() (linea 17 di /home/anasanvi/public_html/sites/all/modules/views_slideshow/theme/views-slideshow-pager-field-field.tpl.php).

bredy73’s picture

Recoverable fatal error: Argument 2 passed to t() must be of the type array, string given, called in /home/sanvitoo/public_html/sites/all/modules/views_slideshow/contrib/views_slideshow_cycle/views_slideshow_cycle.module on line 72 and defined in t() (linea 1720 di /home/sanvitoo/public_html/includes/bootstrap.inc).

cozzamara’s picture

Same Issue for me

cozzamara’s picture

TypeError: Argument 2 passed to t() must be of the type array, string given, called in /homepages/46/d543021126/htdocs/mondospesa/sites/all/modules/views_slideshow/contrib/views_slideshow_cycle/views_slideshow_cycle.module on line 72 in t() (linea 1720 di /homepages/46/d543021126/htdocs/mondospesa/includes/bootstrap.inc).

apvz’s picture

Hello, I think there is a typo for file views_slideshow_cycle.module at sites/all/modules/views_slideshow/contrib/views_slideshow_cycle/views_slideshow_cycle.module, just change

if (module_exists('advanced_help')) {
$output = '

' . l(t('Click here to view the documentation for Views Slideshow Cycle.', 'admin/help/ah/views_slideshow_cycle')) . '

';
}

to

if (module_exists('advanced_help')) {
$output = '

' . l('Click here to view the documentation for Views Slideshow Cycle.', 'admin/help/ah/views_slideshow_cycle') . '

';
}

shamas41’s picture

I had the same issue

shamas41’s picture

Status: Active » Needs review
StatusFileSize
new799 bytes

patch

klauq’s picture

Thanks shamas4. That was fast indeed

And it fixed the bug!

ElineK’s picture

I have this issue as well and rolling back to the previous version doesn't seem to work.
(Well drupal won't accept it and keeps the current version)

error message:
Recoverable fatal error: Argument 2 passed to t() must be an array, string given, called in /home/koogotest/public_html/sites/all/modules/views_slideshow/contrib/views_slideshow_cycle/views_slideshow_cycle.module on line 72 and defined in t() (line 1463 of /home/koogotest/public_html/includes/bootstrap.inc).

cadencia’s picture

The problem is lines 72 and just after in views_slideshow_cycle.module. It's a misplaced apostrophe. It will only show if you DO NOT have advanced help installed.

a quick fix is to grab the line from an old version:

$output = '

' . t('Views Slideshow Cycle help can be found by installing and enabling the !advanced_help', array('!advanced_help' => l('Advanced Help module', 'http://drupal.org/project/advanced_help'))) . '

';

karolus’s picture

Thanks for the quick response!

I tried applying the patch at #10, but it didn't work for me. So, based on Cadencia's comments in #13, manually editing the code did. So far, all's working OK. My edits are below (line 61 in views_slideshow_cycle.module)

/**
 * Implements hook_help().
 */
function views_slideshow_cycle_help($path, $arg) {
  switch ($path) {
    case 'admin/help#views_slideshow_cycle':
      if (module_exists('advanced_help')) {
        $output = '<p>' . l(t('Click here to view the documentation for Views Slideshow Cycle.', 'admin/help/ah/views_slideshow_cycle')) . '</p>';
      }
      else {
        $output = '<p>' . t('Views Slideshow Cycle help can be found by installing and enabling the !advanced_help', array(
          '!advanced_help' => l('Advanced Help module)', 'http://drupal.org/project/advanced_help')))
       . '</p>';
      }
      return $output;
  }
}
nickdickinsonwilde’s picture

Ah two different bugs and I misread Karolus's initial report and missed the 'admin/modules' - read it as 'admin/' which kinda ruined my replication attempts, sorry.
Thanks for the details, fixed. Surprised that localize.drupal.org didn't warn about those since it choked on similar issues.

  • NickWilde committed a877a32 on 7.x-3.x authored by shamas4
    Issue #2841199 by shamas4, karolus, Cadencia: Recoverable Fatal Error...
nickdickinsonwilde’s picture

Status: Needs review » Fixed
ollie222’s picture

Status: Fixed » Needs work

Apologies if this should be raised as a new topic however I don't believe this issue is fully fixed.

The configuration menu at admin/config reports a very similar error but reported on line 48 of contrib/views_slideshow_cycle/views_slideshow_cycle.install .

The issue exists with 7.x-3.3 and 7.x-3.4.

The problem line looks to be with the trailing apostrophe after Github and bracket at the end of the line

            '!url' => l(t('GitHub)', 'https://raw.githubusercontent.com/malsup/cycle/3.0.3/jquery.cycle.all.js', array('attributes' => array('target' => '_blank')))),

and it can be fixed with

            '!url' => l(t('GitHub'), 'https://raw.githubusercontent.com/malsup/cycle/3.0.3/jquery.cycle.all.js', array('attributes' => array('target' => '_blank'))),
mfuller526’s picture

#18 works! I was still unable to enable View slideshow cycle even after updating to 7.x-3.4. AOK now. Hours wasted. Now I can use FlexSlider. Thank you for solution.

nickdickinsonwilde’s picture

Status: Needs work » Fixed

*grumble* I like having test suites... if I do much more on Views Slideshow 7.x I'm gonna have to build a test suite just saves so much time and prevents so many errors - that will only show if you *don't* have jquery.cycle installed so didn't show up in manual testing.
Applied, thanks

  • NickWilde committed 98b0646 on 7.x-3.x
    Fix: Issue #2841199 by shamas4, karolus, Ollie222, Cadencia: Recoverable...

Status: Fixed » Closed (fixed)

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