Add html5 banner in Revive 4.1.1 gives PHP fatal error: Cannot redeclare Plugin_BannerTypeHTML_delivery_adRender

82 Views Asked by At

When I add a html5 banner to a campaign in Revive 4.1.1 and click 'save changes', I get an empty page in the admin. The Apache error log contains:

PHP Fatal error: Cannot redeclare Plugin_BannerTypeHTML_delivery_adRender() (previously declared in /home/applinet/local/ads/www/lib/OX/Extension/bannerTypeHtml/bannerTypeHtmlDelivery.php:31) in /home/applinet/local/ads/www/lib/OX/Extension/bannerTypeHtml/bannerTypeHtmlDelivery.php on line 31

What may be causing this?

I'm using Revive 4.1.1 (upgraded from 4.0 and OpenX before that) with PHP 7.0 and MySQL 5.5 on Debian 9.2 Linux.

1

There are 1 best solutions below

0
Feels Unique On

I would say that you should locate where the function is being declared again and remove it. however....

a dirty fix for this is like so; locate where the Plugin_BannerTypeHTML_delivery_adRender() function is being declared ( in bannerTypeHtmlDelivery.php by the looks of it)

then add this code;

if (!function_exists('Plugin_BannerTypeHTML_delivery_adRender')) {
    // the funtion doesnt already exists so declare it here
function Plugin_BannerTypeHTML_delivery_adRender(){
//all the function stuff here.
}
} 

to clarify.... simply wrap the existing function in the if block.

as i said it is a dirty fix.