Deprecated function: Creation of dynamic property externalhost line 60 of src/Filebrowser.php

Created on 11 March 2025, 3 months ago

Problem/Motivation

We upgraded from version 1 and somehow we have some data that was not massaged over to the 3.1.x design. There would normally have been a hook_update to verify if the schema needed the fix and if so, make adjustments without data loss. Sometimes this is a tall order so therefore I have found a patch that allows the module to continue accepting the legacy externalhost as the new camel case externalHost.

Steps to reproduce

Install filebrowser 1x on Drupal 8. Create some filebrowser records. Upgrade to Drupal 9 1x, then upgrade to Drupal 10 with version 1 or 2 of filebrowser, then upgrade to the latest 3.1.x with Drupal 11. You'll see the issue.

Proposed resolution

See patch

Remaining tasks

Review/commit patch, tag and release

User interface changes

N/A

API changes

Minor

Data model changes

N/A

🐛 Bug report
Status

Active

Version

3.1

Component

Directory Listing Pages

Created by

🇨🇦Canada joseph.olstad

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

Merge Requests

Comments & Activities

  • Issue created by @joseph.olstad
  • 🇳🇱Netherlands clivesj

    hmm... I can't replicate this.
    I used an old site that was created under D6 and upgraded all to way to 11.4

    Maybe I am missing something obvious, but I don't understand why the property would be created dynamically.

  • 🇨🇦Canada joseph.olstad

    Steps to reproduce:

    Install Drupal 8, filebrowser, configure it

    Upgrade to Drupal 9 with filebrowser, use it, add some records

    Upgrade to Drupal 10.1 with filebrowser cofiguration, use it, add some records

    Upgrade to Drupal 10.4 with filebrowser

    Upgrade to Drupal 11

    Drupal 11 requires PHP 8.3, which has the deprecated dynamic properties, some record carried over from previous Drupals results in needing this patch.

  • Issue was unassigned.
  • Status changed to Needs review 21 days ago
  • 🇨🇦Canada joseph.olstad

    we're still using this.

  • 🇳🇱Netherlands clivesj

    Even tough I can not reproduce this error I am seeing some issues with the code that needs te be addressed.
    I will come back shortly on this.

  • 🇳🇱Netherlands clivesj

    I guess you have one or more nodes that have the external host property named as externalhost instead of externalHost.
    I have quite a few sites upgraded all the way up from D6.
    I also installed a clean D8 site and upgraded all the way to D10 without this issue showing up.

    is there a chance you can identify the offending node and get the "properties" value on the table filebrowser_nodes?
    Like:

    O:30:"Drupal\filebrowser\Filebrowser":28:{s:3:"nid";s:4:"1368";s:10:"folderPath";s:13:"s3://promotie";s:10:"fileSystem";N;s:14:"exploreSubdirs";i:1;s:15:"downloadArchive";i:1;s:13:"createFolders";i:1;s:15:"downloadManager";s:7:"private";s:13:"forceDownload";i:0;s:14:"forbiddenFiles";s:36:"descript.ion
    file.bbs
    *.git
    *.svn";s:9:"whitelist";s:0:"";s:7:"enabled";i:1;s:14:"allowOverwrite";i:1;s:8:"accepted";s:41:"jpg jpeg png gif svg txt doc docx pdf mp3";s:19:"overwriteBreadcrumb";i:1;s:11:"defaultView";s:9:"list-view";s:8:"encoding";s:5:"UTF-8";s:13:"hideExtension";i:0;s:14:"visibleColumns";a:7:{s:4:"icon";s:4:"icon";s:7:"created";s:7:"created";s:4:"size";s:4:"size";s:4:"name";s:4:"name";s:8:"mimetype";i:0;s:11:"description";i:0;s:8:"modified";i:0;}s:11:"defaultSort";s:4:"name";s:16:"defaultSortOrder";s:3:"asc";s:13:"gridAlignment";s:10:"horizontal";s:11:"gridColumns";s:1:"4";s:14:"gridImageStyle";s:9:"thumbnail";s:13:"gridAutoWidth";i:0;s:10:"gridHeight";s:3:"100";s:9:"gridWidth";s:3:"100";s:13:"gridHideTitle";i:0;s:12:"externalHost";s:0:"";}
    

    The properties you see here is from a node that existed already on a D8 version. It correctly shows externalHost.

    I could imagine that maybe during the development of the new feature external host, the property name became misspelled, but should flow trough to production.
    We can solve it the way you suggest but maybe there is a cleaner solution
    Waiting if you can provide further info,
    Thanks

Production build 0.71.5 2024