Hello, when enabling the module through drush I get following error:
WD media_browser_plus: Unable to load the media root folder term. Please check the folder management! [error]
WD php: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'parent' cannot be null: INSERT INTO [error]
{taxonomy_term_hierarchy} (tid, parent) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1); Array
(
[:db_insert_placeholder_0] => 121
[:db_insert_placeholder_1] =>
)
in taxonomy_term_save() (line 679 of /usr/local/web/cms-htdocs/modules/taxonomy/taxonomy.module).
Cannot modify header information - headers already sent by (output started at /opt/csw/php5/lib/php/drush/includes/output.inc:37) [warning]
bootstrap.inc:1212
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'parent' cannot be null: INSERT INTO {taxonomy_term_hierarchy} (tid, parent) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1); Array
(
[:db_insert_placeholder_0] => 121
[:db_insert_placeholder_1] =>
)
in taxonomy_term_save() (line 679 of /usr/local/web/cms-htdocs/modules/taxonomy/taxonomy.module).
Drush command terminated abnormally due to an unrecoverable error.
When enabling it through the module interface the error is
Notice: Trying to get property of non-object in media_browser_plus_taxonomy_term_presave() (line 481 of /usr/local/web/cms-htdocs/sites/all/modules/media_browser_plus/media_browser_plus.module).
Notice: Undefined property: stdClass::$tid in media_browser_plus_taxonomy_term_presave() (line 489 of /usr/local/web/cms-htdocs/sites/all/modules/media_browser_plus/media_browser_plus.module).
Notice: Trying to get property of non-object in media_browser_plus_taxonomy_term_presave() (line 489 of /usr/local/web/cms-htdocs/sites/all/modules/media_browser_plus/media_browser_plus.module).
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'parent' cannot be null: INSERT INTO {taxonomy_term_hierarchy} (tid, parent) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1); Array ( [:db_insert_placeholder_0] => 124 [:db_insert_placeholder_1] => ) in taxonomy_term_save() (line 679 of /usr/local/web/cms-htdocs/modules/taxonomy/taxonomy.module).
Can anyone assist me with this? Not sure what the issue is, thanks
Comments
Comment #1
das-peter commentedMay I ask you to you give MBP 3.0 beta1 a try?
Version 3.x was under heavy development lately and thus a bit unstable - with beta 1 quite some testing was done since I extended and enhanced the module tests.
Comment #2
plinto commentedThanks, MBP 3.0 beta1 installs correctly
Comment #3
plinto commentedComment #4
plinto commentedComment #5
chrisschaub commentedI just tried the beta1 and the latest dev for version 3. Both still give this error on a clean install.
Comment #6
das-peter commented@cschaub: Just tested it on a clean installation. No errors.
And I guess the error should be thrown during testing as well, but that's not the case.
Please test again and provide more details if the failure still happens.
Comment #7
BarisW commentedSame here with the 3.0 beta1 install:
Comment #8
das-peter commented@BarisW
That actually looks totally unrelated to MBP.
Comment #9
BarisW commentedHmm, I don't know how to reproduce it and it's not an issue for me anymore. So let's keep it fixed then.
Comment #11
durum commentedI get the following error 2 times while trying to install both 7.x-3.0-beta2 and 7.x-3.x-dev versions. I don't know what else information should I provide.
Comment #12
PI_Ron commentedI get the same two errors when enabling module via drush:
Comment #13
sirtetDitto,
maybe a hint on what exactly the message
Please check the folder management!is trying to tell me?A Taxonomy Media Folders with one term Media Root is there.
Dis- and Re-enabling gave no more errors, but still the browser under /admin/content/file is empty...
Comment #14
kalpaitch commentedBelow it the result of enabling beta3 - drush en media_browser_plus
WD media_browser_plus: Unable to load the media root folder term. Please check the folder [error]
management!
WD media_browser_plus: Unable to load the media root folder term. Please check the folder [error]
management!
media_browser_plus was enabled successfully. [ok]
Folder Media Root created successfully [status]
Comment #15
lavamind commentedSame error here, after running drush en media_browser_plus :
And after running drush cc all :
Comment #16
mr.baileysI ran into the same issue when enabling the module through drush.
media_browser_plus_get_media_root_folder($autocreate = TRUE)callstaxonomy_term_save(), which invokes hook_taxonomy_term_[insert|presave]. Media Browser Plus implements those two hooks, and callsmedia_browser_plus_get_media_root_folder(FALSE)again. Since the root_folder term still has not been created, these two hook invocations cause the watchdog errors.Attached is a patch to resolve this by adding a temporary
autocreate-variable to the $term-object, allowing the hook invocations to be skipped during the auto-creation process.Note that the patch is fairly simple, but since the body of the hooks is wrapped in an additional if, the diff looks more complex than it is. See the no-white-space diff also attached to get a quick idea of the real change.
Comment #18
das-peter commented@mr.baileys Thanks for the debugging, the patch and the explanation! I've changed the condition to
if (empty($term->autocreate)) {and committed it.Comment #20
nrackleff commentedSo is there a patch that will fix this on 3.0-beta3? Does the one in #16 work, or was that changed based on #18?
Comment #21
mrtndlmt commented@mr.baileys Thanks for the patch!