Problem
Steps to reproduce:
- Ensure Views module is disabled
- Install and enable Mediafront module (I tested mediafront-7.x-2.0-rc8)
- Go to /mediafront_getplaylist in your browser
This leads to a fatal error:
Fatal error: Call to undefined function views_get_view() in /var/www/drupal7/sites/all/modules/mediafront/mediafront.module on line 251
Proposed resolution
Since /mediafront_getplaylist needs Views to run properly, I guess Mediafront should have a Views module dependency.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | mediafront_menu_depends_on_views_enabled-2000754-3.patch | 1.69 KB | fengtan |
| #1 | views-dependency-2000754.patch | 754 bytes | enjoylife |
Comments
Comment #1
enjoylife commentedIf you are not using playlists, MediaFront runs fine without Views. But when you use playlists, it requires Views.
Using the most recent dev, I tested this issue with Views disabled and received the same error. Then I enabled Views again and visited /mediafront_getplaylist and received this:
{"error":"Playlist not found."}Attached is a patch that recognizes the dependency issue in the .info file of the module.
Comment #2
travist commentedI don't think I will fix this one since you can use mediafront without the views module just fine. You just need Views if you want playlists.
Comment #3
fengtanOK, but we still expose all users to a fatal error if views is disabled, don't we ?
How about enabling the menu only if views is enabled ? Attached is a suggested patch, any review is welcome.
Comment #4
travist commentedI am alright with this change. If anyone sets this issue to RTBC, I will pull it into the codebase. Thanks.
Comment #5
enjoylife commentedI've tested this.
Comment #6
travist commentedThanks! Committed to 2.x.