digitalmethodsinitiative / dmi-tcat

Digital Methods Initiative - Twitter Capture and Analysis Toolset
Apache License 2.0
367 stars 114 forks source link

Call to undefined function is_url_expander_enabled() #309

Closed jamestripp closed 6 years ago

jamestripp commented 6 years ago

Hi everyone,

I have a fresh install of Ubuntu 16 and TCAT (~1 week old). The capture stopped on Friday. In order to reconnect I ran the dmitcat_track.php script to make sure it could connect followed by controller.php. However, when trying to run controller.php I get a fatal error, below:

PHP Fatal error: Uncaught Error: Call to undefined function is_url_expander_enabled() in /var/www/dmi-tcat/capture/stream/controller.php:148 Stack trace:

0 {main}

thrown in /var/www/dmi-tcat/capture/stream/controller.php on line 148

I'm unable to restart the data capture and would much appreciate any advice you can offer.

Best,

James

02 commented 6 years ago

Hi, I'm experiencing the same issue on a server that has been running since last summer. Our mission-critical TCAT server went down for the same reason after an automatic update a few days ago.

The problem was the commit on March 28, in which @dentoir removed lines 85-87 from "common/functions.php":

-function is_url_expander_enabled() {
-    if (defined('ENABLE_URL_EXPANDER')) {
-        return ENABLE_URL_EXPANDER;

This resulted, unsurprisingly, in the function no longer being defined. Since it's called from controller.php, this will likely have brought down all TCAT servers with autoupgrade activated.

But since it's been Easter, I suppose people are still to notice this.

I'm going to try to add the function again, but would probably be a good idea to fix this asap in the git.

Thanks!

Best, Petter

edit:

Adding:

function is_url_expander_enabled() {
    if (defined('ENABLE_URL_EXPANDER')) {
        return ENABLE_URL_EXPANDER;
   }
}

in functions.php seems to have fixed the issue.

dentoir commented 6 years ago

Hi @jamestripp, tranks for the report this is now fixed.