0

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.

mega6382
  • 9,211
  • 17
  • 48
  • 69
René Pijl
  • 4,310
  • 1
  • 19
  • 25
  • Are you including / requiring the same file twice? If so, maybe you want to use `include_once` or `require_once` _(note: I dont know about anything you're using, just php really)_. – FirstOne Nov 01 '17 at 14:24

1 Answers1

0

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.

Feels Unique
  • 135
  • 2
  • 9