Closed (duplicate)
Project:
Media Browser Plus
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Aug 2012 at 07:47 UTC
Updated:
24 Jun 2014 at 07:48 UTC
Jump to comment: Most recent
Comments
Comment #1
das-peter commentedThe code definitely has a flaw - but I'm not sure of more debugging is necessary to check what actually causes the notice in the drush case. Would be nice to know if there was any other negative effect besides the notice.
However, I've changed the code to be "fault tolerant": http://drupalcode.org/project/media_browser_plus.git/commit/3d5e432
Comment #3
pdcarto commentedI was still seeing the problem - numerous errors following feed import.
I was able to make it go away by setting $autocreate to TRUE in the call to media_browser_plus_get_media_root_folder() on line 1449 of media_browser_plus.module:
$root = media_browser_plus_get_media_root_folder(TRUE);Not sure if that's totally inappropriate!
Comment #4
das-peter commentedWell, if you call
media_browser_plus_get_media_root_folder()with $autocreate = TRUE it's likely that every time creates a new taxonomy term in the related vocabulary.That's not really the idea.
For me it sounds like an issue with the installation. The vocabulary or the root term couldn't be create and now every time someone uses media browser plus it fails.
The reason the error persists even with $autocreate = TRUE is that the user maybe doesn't have the permission to create taxonomy terms.
So if someone is still experiencing this issue it would be great if this scenario could be considered.
Comment #5
Kimitri commentedThis issue still exists in the latest dev. I'm seeing some problems in
media_browser_plus_field_attach_presave:The problem is that when the
media_browser_plus_get_media_root_folderis called without passing the autocreate parameter as TRUE, the root folder may not exist and the return value will not be an object. Themedia_browser_plus_get_media_root_folderfunction checks if the media root folder exists in which case it will not create a new one. So, passing TRUE to this function will fix things.However, I don't think this is the way to go. To me it would be a better way to make the
hook_field_attach_presavecheck if the$rootis an object and that it has a property calledtidinstead of just assuming that things are that way.Comment #6
mr.baileys@Kimitri: I think this should have resolved by #1968690: Unable to load the media root folder term. Could you check? If the problem persists, please reopen this issue.