directory field is not created when installing module together with together with Media Directories Editor and Media Directories UI

Created on 14 December 2022, over 1 year ago
Updated 26 November 2023, 7 months ago

Problem/Motivation

After module installation and setting configuration opening media browser and media views causes error exception
Module version: 2.0.2
Drupal version: 9.4.7

Steps to reproduce

  • install suite: Media Directories, Media Directories Editor, Media Directories UI
  • Save taxonomy configuration at admin/config/media/media_directories
  • Navigate to admin/content/media or admin/content/browser

ER: views are working and operational

AR: error:
Drupal\Core\Database\DatabaseExceptionWrapper: Exception in Medien[media]: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'media_field_data.directory' in 'where clause': SELECT COUNT(*) AS "expression" FROM (SELECT 1 AS "expression" FROM "media_field_data" "media_field_data" WHERE (((media_field_data.directory IS NULL)) OR ((media_field_data.directory IS NOT NULL))) AND ((media_field_data.status = 1 OR (media_field_data.uid = 1 AND 1 <> 0 AND 1 = 1) OR 1 = 1))) "subquery"; Array ( ) in main() (line 19 of index.php).

So, module installation is adjusting views to use media_field_data.directory field but the field is not existing.
Should I somehow add this field to entities? in media types field management field is having system prefix field_directory so I presume it is not helping

Thanks in advance.

πŸ› Bug report
Status

Closed: cannot reproduce

Version

2.0

Component

Code

Created by

πŸ‡¨πŸ‡­Switzerland cassius

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Status changed to Needs review over 1 year ago
  • πŸ‡¨πŸ‡­Switzerland cassius

    Hello ytsurk

    The site works as a multisite feature and there are really a lot of modules.

    Regarding installation - I install the modules via admin UI.

    thank you

  • πŸ‡¨πŸ‡­Switzerland ytsurk Switzerland

    Can you please try the re-installation of media_directories.

    You do this by uninstalling all three modules, and then enabling them again.

  • πŸ‡ͺπŸ‡ͺEstonia rang501 Viljandi

    I just ran similar steps on a clean D9 installation (enabled modules on admin UI). Seemed to work just fine. So I guess module itself is just fine.

    Maybe its some kind of Drupal core thing? I have seen weird issues (configs not imported, modules not really enabled, etc) and they seem to happen when there are a bit more modules or there are traffic on site (for example enabling on production site).

    If re-install is not an option, you could always add a hook_update_N to re-add the field.

  • Status changed to Postponed: needs info over 1 year ago
  • πŸ‡¨πŸ‡­Switzerland ytsurk Switzerland
  • Status changed to Closed: cannot reproduce 7 months ago
  • πŸ‡¨πŸ‡­Switzerland ytsurk Switzerland
Production build 0.69.0 2024