Fixing Empty Date Limitation Dropdown in Revive Server

Published by John on May 19, 2015 Under OpenX

After doing an upgrade from an older 2.X or 3.X Revive Adserver Install, previously OpenX, when adding date/time delivery limitations to a banner, the dropdown only had two visible options ‘is equal to’ and ‘is different from’. The other options, like ‘is earlier than’ or ‘is later than’ were not there. However, there was a space for them in the select dropdown and an option, you just could not see the name of the option.

You can see a screenshot of the Banner Delivery Limitations dropdown below:

delivery_limitations

Since the options were there in the dropdown and just the text missing, I suspected a language issue.

The Problem

After some debugging, I found where this list was being built in the file: /public_html/openx/plugins/deliveryLimitations/Time/Date.class.php

class Plugins_DeliveryLimitations_Time_Date extends Plugins_DeliveryLimitations
{
    function __construct()
    {
        $this->aOperations = array(
            '==' => $GLOBALS['strEqualTo'],
            '!=' => $GLOBALS['strDifferentFrom'],
            '>' => $GLOBALS['strLaterThan'],
            '>=' =>$GLOBALS['strLaterThanOrEqual'],
            '<' => $GLOBALS['strEarlierThan'],
            '<=' => $GLOBALS['strEarlierThanOrEqual']
        );

        $this->nameEnglish = 'Time - Date';
    }

The above is using the Revive Adserver $GLOBALS variables to set the names different options. After searching for the missing names, like ‘strLaterThanOrEqual,’ I found that they were not part of the new language definitions for most languages, including English.

The Fix

A quick(non-update proof) fix is to just add the missing variables back to your language definition file. For English, you can find the file here: /public_html/openx/lib/max/language/en/default.lang.php

Add the bottom to the file:


/* MOD: - fix missing delivery option language variables. Important note, this file will be overwritten on update! */

$GLOBALS['strEarlierThanOrEqual']         = "is earlier than or equal to";
$GLOBALS['strEarlierThan']                = "is earlier than";
$GLOBALS['strLaterThanOrEqual']           = "is later than or equal to";
$GLOBALS['strLaterThan']                  = "is later than";

Important Note for Non-English Users:

* The above file is for English, so you would want to edit the correct language file if you are not using english.
* I found that three languages probably still had these definitions, specifically: Russia, Portugal, and China, so this issue might not impact these countries.

Problems with this Fix

One problem is that during your next update, the default language file for OpenX will be overwritten and these changes lost. Another option would be to edit the Date.class.php in the DeliveryLimitations plugin to use updated language variables. I found some, although not all, had new or similar definitions that could be used.


No Comments |

Add a Comment