Problem

Steps to reproduce:

  1. Ensure Views module is disabled
  2. Install and enable Mediafront module (I tested mediafront-7.x-2.0-rc8)
  3. 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.

Comments

enjoylife’s picture

Version: 7.x-2.0-rc8 » 7.x-2.x-dev
Status: Active » Needs review
StatusFileSize
new754 bytes

If 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.

travist’s picture

Status: Needs review » Closed (won't fix)

I 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.

fengtan’s picture

Status: Closed (won't fix) » Needs review
StatusFileSize
new1.69 KB

OK, 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.

travist’s picture

I am alright with this change. If anyone sets this issue to RTBC, I will pull it into the codebase. Thanks.

enjoylife’s picture

Status: Needs review » Reviewed & tested by the community

I've tested this.

travist’s picture

Status: Reviewed & tested by the community » Fixed

Thanks! Committed to 2.x.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.