Download & Extend

Update error interaction with Features

Project:Custom Formatters
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Updated to the current dev version of Custom Formatters and update.php threw the following error:

Fatal error: Cannot redeclare features_tar_create() (previously declared in [redacted]/sites/all/modules/custom_formatters/custom_formatters.admin.inc:543) in [redacted]/sites/all/modules/features/features.export.inc on line 441

Should I also report this over at Features?

Comments

#1

Hi shiva7663,

If anything, this issue is with Custom Formatters, not Features, as I replicated a section of code from Features so as not to re-invent the wheel. The code is wrapped with a condition that is supposed to prevent if being redeclared if Features is present, but it's possibly not happening.

Will look into it ASAP.

Cheers,
Deciphered.

#2

sites/all/modules$ grep -aire features_tar_create *
custom_formatters/custom_formatters.admin.inc:  $tar = features_tar_create($tar);
custom_formatters/custom_formatters.admin.inc:if (!function_exists('features_tar_create')) {
custom_formatters/custom_formatters.admin.inc:  function features_tar_create($files) {
features/features.admin.inc:    $tar = features_tar_create($tar);
features/features.export.inc:function features_tar_create($files) {

custom_formatters comes first sometimes (I'm experiencing this with drush).
So either rename the function in custom_formatters or add the condition to features as well.

I chose the latter for now.

#3

Guaka,

Are you implying that because Custom Formatters is being loaded first that the function does not yet exist, therefore if (!function_exists('features_tar_create')) { is returning TRUE and causing the re-declaration of the function? I guess it's plausible, will have to look into this.

Adding the condition to Features is not really an option, if anything I should rename the function in CF, but a third option would be to make the condition work :)

Will look into this further ASAP.

Cheers,
Deciphered.

#4

I added some markers to the files and quickly checked:

$ drush features-update maps
CUSTOM_FORMATTERS.ADMIN.INC
FEATURES.EXPORT.INC
Module appears to already exist in sites/all/modules/custom/features/maps
Do you really want to continue? (y/n): y
Created module: maps in sites/all/modules/custom/features/maps                                                                     [ok]

So yes, custom_formatters comes first.

#5

Status:active» fixed

Fixed, committed to DRUPAl-6--1. Dev release should be out shortly.

Cheers,
Deciphered.

#6

Confirmed. Thank you.

#7

Status:fixed» closed (fixed)

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

nobody click here