Using Drupal 5.2 and OpenAds. Both have been working fine. But I just did something that completely crashed my Drupal site, and LOCKED ME OUT of fixing it!

I added a new block to display OpenAds text ads. (I already have other blocks displaying OpenAds, it's all been A-OK.) I pasted into the block the OpenAds Invocation Code, which is a bit of PHP, and I set the block to accept the PHP. Then I saved the block. I'm using OpenAds code directly in Drupal blocks; I haven't been able to get the OpenAds module to do anything useful.) To check it, I set the new block to show in the right column of my site, same as I've done with all my other OpenAds blocks.

BAM! Drupal showed a blank screen with message "Openads has been installed, but no configuration file was found."

As of this moment I don't know what this means, because OpenAds is working OK (and continues to work now that I cleared the problem).

Trouble is, the block was in the right column of every Drupal page, including admin pages. So, I was instantly locked out of going back and fixing or removing the bad block. Every Drupal page including admin pages showed me nothing but the error message.

I knew OpenAds had been working fine 2 seconds earlier, so I didn't take the error message as being accurate. Instead, I focused on getting rid of the bad block. But I couldn't use Drupal to edit it.

My solution was to open my Drupal database using phpMyAdmin, locate the new/bad block in table "boxes", and edit the "body" field to remove the PHP code from this field -- the Open Ads Invocation code I'd put there. This instantly unlocked Drupal. That's good!

But what's bad is how easily Drupal got wiped out, because OpenAds is intended to be used by business people to create and schedule ads.

I'm not sure there's a solution when putting PHP in a block, but it would be terrific if there was a way to get into Drupal admin "clean", without loading blocks or other "external" stuff. Or, maybe Drupal could error-trap situations like this.

I now vow to do two things:

1. Before making a new block visible that contains PHP or other risky content, I will make sure to set "Page specific visibility settings" to "Show on every page except listed page" and in Pages specify "admin/*". This probably will let me access admin/build/block to deal with a problem.

2. Try to avoid OpenAds PHP Invocation code, and instead use JavaScript when possible.

But still, could there be a way to protect Drupal from this?

I haven't determined why OpenAds' PHP Invocation Code failed, but I just switched the new block to use JavaScript and the ad displays successfully -- and Drupal is happy.

I hope this helps others avoid my mistakes, or at least know how to recover from them.

Comments

jshuell’s picture

One thing I noticed with openAds is it sets the PHP path variable to what it needs and then Drupals settings are wiped out. I had to remove the offending code from openAd and combine it with Drupals setting of the variable in order to get them working. Not sure if thats what you experienced but just a warning for others investigating openAds. The latest release says they fixed that dependancy but I still see the code in that release as well.

Quint’s picture

Thanks for the tips. But this makes me wonder... where are you guys running your OpenAds Server?

_ Same domain (folder)?

_ Sub-domain? Add-on domain?

_ Same host, different domain?

_ Different host?

And jshuell, how about you, are you using the Openads module?

thanks,
Quint

JillJack’s picture

try this link...
http://forum.openads.org/index.php?showtopic=503414862

It worked for me the suggestion on post #2

Ningbo1’s picture

Thanks!! I had the same exact problem. Boy, did I freak out. Thank goodness you had this guide here. I switched to javascript and it works now. However, there are a lot of spaces between my ads now. Before, they were flush up against one another, and now there's a lot of whitespace that makes them take up more room. :(

And going to example.com instead of www.example.com worked to get into the admin interface. But openads is pretty brain-dead if it thinks that those are two different websites...come on.