In textimage_menu() the module calls getDirectoryPath() function of the stream wrapper, but this function exists on local stream wrappers only. This breaks any cache flush with the following error (class name is the stream wrapper):

PHP Fatal error:  Call to undefined method [class name]::getDirectoryPath()

Patch follows.

CommentFileSizeAuthor
#1 textimage-1889032-1.patch1.93 KBdmitriy.trt

Comments

dmitriy.trt’s picture

Status: Active » Needs review
StatusFileSize
new1.93 KB

Patch fixes the fatal error only. There is one more call to the getDirectoryPath() of the stream wrapper without it's check, so issue needs more work after fixing the critical part. Unfortunately at the moment I can't work on it, because we're using Textimage module directly through the API only.

mondrake’s picture

Hi, and thanks for the patch.

Does this mean that
a) in your environment you are overriding the local stream wrapper for 'public' with some other wrapper, and
b) you are only generating Textimage images through theme('textimage_image', ...) passing a file_path key through the variables?

dmitriy.trt’s picture

Hi,

a) "public://" is just a default scheme to store files on local filesystem. We're using Azure module to create custom "azure-storage://" scheme with non-local stream wrapper. This scheme is selected as "Default download method" on the admin/config/media/file-system page.
b) We use it in a bit different way, by direct calls to textimage_get_presets() & textimage_image_from_preset(), because preset has to be adjusted for each and every image and result image is copied to the other GD image in our case.

mondrake’s picture

Alrigth, thanks for feedback.

It makes sense to me; I will wait 2 weeks to see if any community review comes, and then commit it to dev.

I do not think the other instance of getDirectoryPath() poses a problem, since if the menu path does not get created, as per your patch, textimage_deliver() will never get invoked.

mondrake’s picture

Status: Needs review » Fixed

Committed and pushed to dev. Thank you!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.