Error: Call to a member function toUrl() on null in views_jump_menu_preprocess_views_jump_menu() (line 108 of modules/contrib/views_jump_menu/views_jump_menu.module)

Created on 12 June 2024, 6 months ago

Problem/Motivation

White screen error when url_field is empty.

Steps to reproduce

Create a views_jump menu with empty url field i.e. group module jump menu with no assigned groups to the user.
It can be anything where url_field is empty/unset.

Proposed resolution

check also for `$optione['url_field'])` to be !empty()

Remaining tasks

review and apply the patch

User interface changes

none

API changes

none

Data model changes

none

🐛 Bug report
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

🇳🇱Netherlands florisg

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @florisg
  • 🇳🇱Netherlands florisg

    added the patch for views_jump_menu.module
    ```
    - if (!empty($options['label_field'])) {
    + if (!empty($options['label_field']) && !empty($optione['url_field'])) {
    ```

  • 🇳🇱Netherlands florisg

    This was defined underneath, so update to $view->field[$options['url_field']] for the check.

  • Status changed to Closed: works as designed 6 months ago
  • 🇳🇱Netherlands florisg

    Please ignore and close this issue, requiring the relation fixed it.
    Checking only for the label is enough for these are defined in a combined array.

Production build 0.71.5 2024