storytlr icon indicating copy to clipboard operation
storytlr copied to clipboard

/admin/post/image and /admin/post/audio errors

Open kylehase opened this issue 14 years ago • 6 comments

v1.0 PHP error when loading /admin/post/image and /admin/post/audio. Other /admin/post/ pages load fine. The error is as follows:

PHP Warning: in_array() expects parameter 2 to be array, null given in /var/www/storytlr/protected/application/admin/controllers/PostController.php on line 867

That line references Twitter credentials which are commented out in my config file.

;; Twitter settings ;twitter.username= ;twitter.password= ;twitter.default.hide_replies=1

Ubuntu server 10.04.1 x86_64

kylehase avatar Aug 19 '10 14:08 kylehase

Thanks for pointing this one. I understand from your post that only a warning is generated ? i would advise you to put debug=0 in your config.ini to avoid warning being displayed if that is the case. Let me know if it is an error that prevent you from posting.

eschnou avatar Aug 19 '10 16:08 eschnou

My post was unclear. Both the image and audio post pages display:

Ooops Hmmm.... something just went wrong. The error has been logged and our code monkeys will look into it as soon as they are back from their daily walk in the park.

The PHP Warning was from my server log. Debug was and still is 0.

kylehase avatar Aug 20 '10 00:08 kylehase

I could not reproduce the problem so far, so I need more help. A stack trace must have been generated in protected/logs/applicationException.log. Can you please look it up and share it with me ? Either here or by email: laurent at eschenauer.be

eschnou avatar Aug 20 '10 14:08 eschnou

Found the problem. The install instructions mentions write permissions to

feeds/ protected/upload/ protected/temp/ protected/logs/

but the config.ini.sample includes the following which I didn't realize were overrides of the default subdirectories in "protected/" (is that correct?)

#path.upload = /tmp/upload
#path.logs = /tmp/logs
#path.temp = /tmp/temp
#path.feeds = /tmp/feeds

I uncommented and edited the config lines as follows but only created and chown'd the /tmp/storytlr/ directory, expecting storytlr to create the subdirectories from there.

path.upload = /tmp/storytlr/upload
path.logs = /tmp/storytlr/logs
path.temp = /tmp/storytlr/temp
path.feeds = /tmp/storytlr/feeds

If it is correct that these config lines are overrides for the default "protected/" subdirectories, may I suggest the following:

  1. Update the install guide to mention these overrides.
  2. Add a note to config.ini.sample that these lines override the default "protected/" subdirectories and must be manually created.
  3. Create the subdirectories at runtime if they don't exist.

kylehase avatar Aug 21 '10 02:08 kylehase

The PHP warning does not seem to have been critical but can be reproduced by unchecking all the boxes on example.com/admin/sns/.

kylehase avatar Aug 21 '10 02:08 kylehase

Thanks Kyle, good points. Will definitively makes this clearer. Indeed; it is an 'advanced' config :-) In my personal case, I have all the data in /var/storytlr and the logs in /var/logs/storytlr. By the way you can also have the config.ini in /etc/storytlr/config.ini

By this, you can have all 'dynamic' files outside of the project folder, and thus you can easily switch releases, upgrade, or run on systems like EC2 (where the host storage is ephemeral).

eschnou avatar Aug 24 '10 08:08 eschnou