Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am getting PHP Notice: Undefined variable: output in views_slideshow_help() (line 25.
Return statement needs to be inside switch case to avoid returning undefined variable $output.
function views_slideshow_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
// Main module help for the gss module.
case 'help.page.views_slideshow':
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('Views Slideshow can be used to create a slideshow of any content (not just images) that can appear in a View. Powered by jQuery, it is heavily customizable: you may choose slideshow settings for each View you create.') . '</p>';
$output .= '<h3>' . t('More Information') . '</h3>';
$output .= '<p>' . t('For more information about this module visite the <a href="@link">Views Slideshow</a> module page.', array('@link' => 'https://www.drupal.org/project/views_slideshow')) . '</p>';
return $output;
}
}
Comment | File | Size | Author |
---|---|---|---|
#5 | undefined_variable_output_2845199_5.patch | 1.02 KB | keithm |
|
Comments
Comment #2
tbrix CreditAttribution: tbrix commentedCreated a patch for this issue.
Comment #3
NickDickinsonWildeComment #4
NickDickinsonWildeThanks for the patch! As this is for 8.x-4.x branch it requires tests for any bug fixes; I'll make a test.
Comment #5
keithm CreditAttribution: keithm commentedFixed #2 to avoid concatenating to undefined variable on line 17.
Comment #6
NickDickinsonWildeComment #7
NickDickinsonWildenah further look and this doesn't need a test.
Applied, thanks both of you!
Comment #8
NickDickinsonWildeComment #10
itapplication CreditAttribution: itapplication at iTApplication.net commentedI also get this error for Version: 8.x-4.3
Any idea how to fix this? Please help.
Comment #11
itapplication CreditAttribution: itapplication at iTApplication.net commentedComment #12
NickDickinsonWildeUpdate to the latest dev release or wait for the next stable release. (to be clear, the dev release is stable rn)
Comment #13
brandonratz CreditAttribution: brandonratz as a volunteer commentedConfirming fix works in 8.x-4.x-dev
Comment #14
quesix562 CreditAttribution: quesix562 commentedI received this error after installing version 8.x-4.3 and clearing the caches.
Notice: Undefined variable: output in views_slideshow_help() (line 23 of modules/contrib/views_slideshow/views_slideshow.module).
views_slideshow_help('system.status', Object)
call_user_func_array('views_slideshow_help', Array) (Line: 391)
Comment #15
NickDickinsonWildeI'll release a new stable version in the next few days - it is fixed in 8.x-4.x-dev.