Hi,
I have installed Imagecache Actions module and activated Image effects text. I used to add text effects on images without any problem until I updated the imagecache actions module some time back. After the update it does not let me add text effects at all. It shows a page with a white background and a header "Add Text effect" but there's nothing underneath it to add text effects.

I'm pretty sure this happened after updating the module but I think I missed an update in between. Does anyone know a solution to fix this? Any help would be very much appreciated.
Thanks

tl;dr

For those arriving here via search: after a long search the only reason we have found so far is excess memory consumption. Enable display_errors or see your PHP log to confirm that is also the case for you. If so, increase your memory_limit or disable no longer needed modules.

A possible cause of this might be the token support. Comment #28 indicates what lines to change to test so. If that helps, leave those lines as you changed them.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fietserwin’s picture

- Did you run update.php?
- Did you clear all caches? (though this is normally done by update functions from this module if necessary.)

lavms’s picture

Hello,
Thanks so much for replying and I'm sorry for the delay. I think I ran update.php, but this was done some time back and I'm not exactly sure. I definitely cleared all the caches. Would that fix this issue if I run update.php now? Please advice.

Thanks & Regards

fietserwin’s picture

It never hurts to run update.php another time.

Regarding your problem, it looks like the form does not load or at least does not render. This can be because the naming of the function that returns the form has changed. needing a clear of the image_styles cache. Other thngs that can go wrong, there are new dependencies on files, but it looks like this cannot go wrong.

If clearing the caches does not help, I want you to debug to see if the function image_effects_text_form_inc() in file image_effects_text.inc gets called at all. Can you also have a look at the drupal log and php log to see if anything gets logged?

lavms’s picture

Hi fietserwin,
Many thanks for the detailed reply. I really appreciate that. I'll try to debug and see what's happening there.

Regards

fietserwin’s picture

Status: Active » Postponed (maintainer needs more info)

Any new insights? does the problem still occur?

If so, please post any information you found while debugging or any other information that might help us to locate the problem.

If not, please close this issue.

sophiejones’s picture

Hello
I am having the same problem. It was working. I started with the latest version to begin with. It was working fine till I needed to create the third image style using text and I no longer could get to text configuration page. same as this issue, just title and blank screen.
I did all the steps and under log found out there was one orphaned image style due to disabling auto_entitylabel. So i removed it completely cleared cache. I also checked to make sure that image style is not being used anywhere at the site.
cleared cache again. but I still cannot access the text configuration page. And I am getting no notice or error on the log messages either.
I have no idea what else to check. I even deleted all image style that i used imagecache_action for, then disabled and uninstalled imagecache_actions completely. then i installed and enabled it again.
Nothing helps. I do have system wrapper enabled. I am not using php.

fietserwin’s picture

Can you do some debugging? I am looking at the code and cannot see how it would fail, perhaps a hidden dependency, but that would give a WSOD and an error in the php log, not just the title with a blank page.

Start debugging by setting a breakpoint at file image.admin.inc, start of function image_effect_form() at line 391. See if gets to line 411 ( $form['data'] = call_user_func($effect['form callback'], $effect['data']);) and what the result is after that line.

sophiejones’s picture

Hello
I did it the hard way, by duplicating steps on a dev platform again. I have a custom content type that I use conditional fields since it is a multipurpose content type. after setting up these dependencies. the same thing happened again.
It is definitely after setting up the dependencies. Do you know why using conditional fields can cause this??
I am sorry, I cannot be more help. I am not a developer and my knowledge of code is basic.
What I don't understand is the token I have used for text is [node:title] and this is not affected at all by these conditional fields.

fietserwin’s picture

Thanks for diving deeper into the problem. I installed the mentioned module in a local environment and it still works for me, so there must be more. As said, the code looks good, I can't find any line that may cause this. So I need your help.

- Assuming that conditional fields has to do with it, it may be there but hidden. Can you check with your browser development tools if the form elements are there (but hidden)?

- If you temporarily disable that module, does the form reappear?

- Another possibility is that another module inadvertently refuses access to the element by setting the #access key on the form element to FALSE. But for that you will need to debug the PHP code.

sophiejones’s picture

Hello
I have some finding that I would like to share with you and I hope with your experience you can make sense of it more than i do. I had initially created the first three style with text prior to setting up the conditional fields and had used the available tokens at the time for them.
2. after setting up those conditions, i no longer could access the text effect page, it would come out blank.
3. I did two things. 1st. i deleted the text effects. flushed cache etc. then did a backup and reinstalled a new site and used this backup. (conditional fields are still in existence but the text effect removed) on this new installation and backup. I now enabled text effect again. and proceeded to create one (the previous text effects were deleted so those tokens were not being used) and i was able to easily access the text effect configuration page. but now the tokens that were available previously and i had used, are no longer available. for one I no longer have tokens for field collection available to me.
4. on another scenario, i completely deleted the conditional fields. and that made the add text effect working normally and the tokens are all there including the one i needed for field collection.
what is happening??
for one thing, i learned if I am using conditional field, i need to set it up first. then try to use text effect and it works, except now some of the tokens are no longer available. and I am very sure this is as a result of using the conditional fields.
I am guessing when i had previously used those token and conditional field cause them to be no longer available, cause the orphaned situation and hence resulted in text effect not working since it was using those tokens that were no longer available or valid. does that make sense??
second thing, that validates this, when i deleted all the conditional fields, and cleared cache, text effect works as usual and those previously created text effect were all accessible and the tokens were available.
this must be something to do with conditional field and field collection. as it happened i was using one of those text effects for field collection item and had used an available token for it.
somehow conditional field and its usage makes those token unavailable.
Conclusion: this is not this module's issue, i don't think. it is conditional fields and field collection issue, there is something that causes tokens for field collection to completely disappear, so if any is in use, leads to orphan situation which led to the issue with text effect configuration page.
this module works as expected and the only reason i received blank because the token I had used was no longer correct so an error of orphaned situation was occurring which had to be fixed (my two options essentially fixed it, perhaps not the professional way but did the job)
Now I have to figure out what is going on with this token issue and why in God's name conditional field causes the tokens for field collection to disappear.
thank you so much for your help and quick responds. I wonder what is at fault here, token? conditional fields? collection field?? But the one that is not at fault and is doing its job beautifully is the text effect.
Thank you so much for all your hard work and this fantastic and very useful tool. and I apologize if I didn't realize what was going on before but your assurances made me realize I need to dig deeper and look for another and real culprit.

dman’s picture

Thanks so much for the investigation and feedback.
Without that detective work, it sounds like it's true we'd never be able to guess from this side what's going on.
It does sound entirely mad, and I think your conclusion about the conflict is probably right. It would certainly explain why the text effect stopped working - if the tokens stopped being available.
It's hard to guess how this can be fixed, but your issue report does mean there is at least some strong clues to go forward from!

fox_01’s picture

i got a similar problem. it went all well till enabling the image cache actions text effect module (was using image cache actions before). i cant add new effects of any kind on existing styles. just a endless loading browser window. If i create a new style i can add text effects but i cant save the new style settings

fietserwin’s picture

#12: Seems like another problem. Please open a new issue if so.

Leeteq’s picture

Version: 7.x-1.4 » 7.x-1.x-dev

Hmmmmm, so could this module check for such orphaned or missing tokens and handle it in a way that gives the user both relevant info/insight and offer to correct it without loosing the access to edit the effects?

(Perhaps create a separate feature request for this.)

Leeteq’s picture

Status: Postponed (maintainer needs more info) » Active
fietserwin’s picture

Status: Active » Postponed (maintainer needs more info)

I still can't figure out what is going on here and if the cause could be the same in all reports (OP and @sophiejones). I haven't been able to reproduce it, not even with the detailed report of #10, nor can I see any thing that could go wrong using tokens when I reviewed the pieces of code that do the token handling.

So, for me this is not a bug in this module until someone comes with reproducible steps and/or a patch pinpointing the code that contains the error.

cosmicevents’s picture

I have the same problem, and as this is on a live website where I heavily used conditional fields, I can not remove or turn off this module. As I use both modules for about two years now, the problem started about 6 months ago, I assume after an update.

But I find a way around, by using another website, which doesn't use conditional fields module.
via export - import, I can edit the image styles. Then I import the style again to my live website, and all works perfectly.... till now...
I can do all kinds of style editing, but if I use more than two text lines, and then try to import the style I get:

"The Image style import data cannot be imported as an image style."

I hope this info helps... but if you need a test site with the actual problem, I could park a copy of the live site somewhere.

fietserwin’s picture

The import problem looks like an issue on its own. Can you open a separate issue for that and include the export text that fails to import?

Regarding this problem: I think I really need to debug this, as I still can't make anything of it. So a copy of a site giving the problems could help if I could get FTP access so I can quickly upload versions with additional logging/reporting (debugging the difficult way). Better would be a (minimal) setup that leads to a system that gives the reported problems, so I could debug locally.

Vincent_Jo’s picture

Hi,
same situation here as #1.

Cant´t add nor even edit an existing text field in image-styles.

My site is in production, I can´t do some experiments (uninstall moduls etc...)

Imagecache Actions module: Version: 7.x-1.5
and activated Image effects text.
Using tokens in the text-field.

Is there any solution in the meanwhile?

regards

edit: just realized, that there is "Image Effects Text test" sub-module, activated this: same problem, by trying to edit/override
Style: text-test-position-orientation

fietserwin’s picture

Please debug the code to find out hat is hindering the text effect, because the text effect does work but not under certain conditions, think when some other contrib modules are installed.

Vincent_Jo’s picture

Thank you for your quick response!

I don´t know how to debug a code, sorry.
I tried aleady to follow your advice in #7 but actually I don´t know how/where to start with it.
My bad.

I didn´t yet install the latest dev version because the starter of the thread related it to the 7.x-1.x-dev version.

I´ll go on to find out how to debug ...

thanks for your help with this issue - which I have to solve very quickly ...

regards

Vincent

Vincent_Jo’s picture

....fishing in troubled waters

It´s pretty clear, that it´s not a bug in text-effect module ...

Problem occured - probably - after a generall update of core and modules several weeks ago.

I´ve got an image field with a custom text field (copyright-info) applied in the content-type which gives me the token to print onto the image.
Example (images in the slider, text bottom/right):
http://prag-aktuell.cz/katalog/punkwahoehlen

Text-effect doesn´t work at all (anymore) not just editing of the styles failed, but also newly entered nodes/images don´t print the tokens.

What kind of functions (modules) could get in conflict with it?

I don´t know how to debug correctly :-/

Firebug - konsole says after entering:
$form['data'] = call_user_func($effect['form callback'], $effect['data'])

ReferenceError: $form is not defined

but this doesn´t tell us much, right?

Vincent_Jo’s picture

Hi,

Unfortunately I have to reopen this issue.
Still no luck to get this to work (again).
And couldn´t find a workaround to avoid image text effect.

Did anybody of the posters before me find a solution?

My situation once again:
I cannot edit or add text effect to an image style. Existing styles won´t work anymore.
When trying to open the text-effect field inside an image style. I get a plain html page loaded. With no way to edit my text style.
No errors in dblog.
Today I got first visible hint displayed on frontend, when opening a page where image with text effect is loaded:

Warning: Failed to calculate text dimensions using GD toolkit. Ignoring the alignment settings.

Searching for this leads me to: image_effects_text/image_effects_text.inc

Could that be a hint where to go on?

regards
Vincent

dman’s picture

One of the ways you can get the notice "Failed to calculate text dimensions using GD toolkit" is if the font the effect expects to use is unavailable. But in general it means 'trying to render the text has failed'.

I can't replicate the problem you report with the current codebase, and although some of the 'tests' that come with the package have some issues of their own -

"When trying to open the text-effect field inside an image style. I get a plain html page loaded. With no way to edit my text style."

sounds strange. There is a chance it's related to a version upgrade, but I can't see how that's possible on a clean system, or without knowing what errors the system is throwing that would make a "plain html page" - do you mean just un-themed, or totally blank? If you get a WSOD, errors may have ended up in the Apache logs, (eg, /var/log/apache2/error.log ) not the watchdog.

Anyway - what I would do - if I can't edit the existing text effect - is just delete that problem action from the image style and remake it.
If that's not possible, delete the whole image style and remake it - it can't be too complicated. You probably don't have to worry about it breaking displays elsewhere if you remake it immediately with the same machine_name.

For more diagnostics, you can 'export' the image style from admin/config/media/image-styles and share it in the issue queue (as fiertswin described in #18 above)

Vincent_Jo’s picture

Hi, thanks for trying to help me ...

first of all, your hint with missing font was right. there was indeed the font missing in the directory.
Now the existing image styles with text-tokens work again when editing content.

But the problem still persists that I can´t edit or add a text-action to a style.
"Plain HTML" means, a page (admin/config/media/image-styles/edit/MyTextStyle/effects/130) opens unstyled with some drupal settings links (breadcrumbs on top) but without any link or field to edit the text style. See attachment.

I flushed caches, run update.php after realized and reloaded the missing font (my bad to put it in the module´s directory where are all the other fonts the module provides lay - There must have been a module update I don´t have knowledge about)

Same missbehaviour: unable to edit or add text-styles.

This is the style I could export:

a:3:{s:4:"name";s:20:"vizitky_flex_806x300";s:5:"label";s:20:"vizitky_flex_806x300";s:7:"effects";a:2:{i:29;a:3:{s:4:"name";s:20:"image_scale_and_crop";s:4:"data";a:2:{s:5:"width";s:3:"806";s:6:"height";s:3:"400";}s:6:"weight";s:1:"1";}i:130;a:3:{s:4:"name";s:18:"image_effects_text";s:4:"data";a:12:{s:4:"size";s:1:"9";s:4:"xpos";s:8:"right-10";s:4:"ypos";s:8:"bottom-5";s:6:"halign";s:5:"right";s:6:"valign";s:6:"bottom";s:3:"RGB";a:1:{s:3:"HEX";s:7:"#ffffff";}s:5:"alpha";s:3:"100";s:5:"angle";s:1:"0";s:8:"fontfile";s:65:"sites/all/modules/imagecache_actions/image_effects_text/Arial.ttf";s:11:"text_source";s:4:"text";s:4:"text";s:23:"[file:field_bildquelle]";s:3:"php";s:316:"if (!$image_context['entity']) {
  return 'No referring entity';
}
$entity_type = 'node';
$field_name = 'my_field';
$entity = $image_context['entity'];
$field = field_get_items($entity_type, $entity, $field_name);
if ($field) {
  return isset($field[0]['value']) ? $field[0]['value'] : 'No field value';
}
";}s:6:"weight";s:1:"2";}}}

I can´t even create a new image-style with text action. So no way to "remake" the style.

I´m happy now with the situation that existing styles are working !!!
I just need to create one more new ...

thanks

regards
Vincent

fietserwin’s picture

Thanks for the new info. What does this give us:
- page rendering is halted, either due to a fatal or by an exit.
- we do know that Drupal arrives at a point just before calling the form callback.
- knowing that other effects work, it is likely that the tet effect form callback fails with a fatal.

So to get this fatal:
1) go look in the log
- go to admin/reports/status/php and see for the values of log_errors (if logging is on) and error_log (where errors are logged)

2) reproduce but now with display_errors set to 1/true/on.

When we have this error message we can continue our quest.

Vincent_Jo’s picture

Hi, really appreciate your help, thanks ...

log_errors = on
error_log = no value
display_errors = On

When trying to edit text action, resulting in the page-display described above, I finally get:
Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 26355138 bytes) in /var/www/clients/client1/web2/web/includes/database/database.inc on line 2171

Well, I think I have to pass this over to the server administrator! right?

Just before I had an idea for a workaround: As it is working to export and import a style. I could export/import the existing style and change then the resize/crop, what can be edited as usual. The text-style (with token) should stay the same anyway. Just an idea ... will try that

regards
Vincent

fietserwin’s picture

Well ...
- Your memory limit is around 512MB, that should normally suffice.
- Executing a PDO statement is trying to allocate 26MB! Whow, that is quite an amount for 1 db statement.
- Your memory allocated when it gets to the form building is already around 500 MB. That's incredibly high.
- Setting a smaller memory limit on my local test/dev I was able to reproduce with even the same output to screen. That happens when the memory gets exhausted while processing drupal_deliver_page().

This means it is hard to pinpoint it to just one part of the system, but I would go look for modules that are known memory busters and try to disable them. Start with devel, admin_menu, perhaps some token related modules. You can also try to diable the token field: comment out the lines:

  $tokens = token_info();
  $tokens = array_keys($tokens['types']);

and the lines

    'token_help' => array(
      '#type' => 'fieldset',
      '#title' => t('Token replacement patterns'),
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
      'tree' => array(
        '#theme' => 'token_tree',
        '#token_types' => $tokens,
      ),
      'token_module_notice' => array(
        '#markup' => !module_exists('token') ? t('You might want to enable the token module to view token replacement patterns.') : '',
      ),
      'entity_token_module_notice' => array(
        '#markup' => !module_exists('entity_token') ? t('You might want to enable the entity_token module to get token options for all entities and field properties.') : '',
      ),
      '#states' => array(
        'visible' => array(':input[name="data[text_source]"]' => array('value' => 'text')),
      ),
    ),

in the file sites\all\modules\imagecache_actions\image_effects_text\image_effects_text.inc and see if that helps.

Vincent_Jo’s picture

thanks a lot, I´ll try that.

together with the server administrator we were not very successfull, but
My workaround for creating a new style/text_action by export/import works so far.

regards

jo)

Vincent_Jo’s picture

Hi,

success with commenting out these lines as you suggested above(#28)!
Editing text_action works now as designed.

Is it ok to leave these lines commented out?

Thank you very much for your investigations!

Is was very important to get this feature to work again, because we have to print/display some legal notices into certain images. We are not legitimized to publish these images without that.

regards

Vincent

fietserwin’s picture

Title: Add Text effect is not working anymore » Add Text effect form is not showing
Status: Postponed (maintainer needs more info) » Closed (works as designed)

These lines give you token support. It is one of the few things that is unique to this effect form, so that's why I advised you to start with trying those lines (+ that tokens are are mentioned in other comments).

We will not disable token support completely. So I could write some code to disable that optionally, but so far we don't have any settings form in this module and I don't want to change that anymore. Alternatively, I could introduce a variable and let the UI be handled by the variables module. But even then, it looks like we would be coding to avoid enormous memory consumption of others. So, with 91K installs (not all having text effect enabled and in use of course) and only a few reporters here, I think I leave it to this and am not going to change anything. I will add a tl;dr to the issue summary for reference purposes.

fietserwin’s picture

Issue summary: View changes

updated the IS.

Vincent_Jo’s picture

Hi,
I don´t want to reopen this, just a comment.

The token support still works for me, even with the lines outcommented.
I just did a quick test with a new style + text+token and attached this style to an image in views ... no problem.
I needed this text_action submodule just because of this - unique - token support!

thanks once again

Vincent

fietserwin’s picture

Ah yes, but you have to type them in manually without a list of tokens that you can use.

Vincent_Jo’s picture

Ah, ok, didn´t remember this feature

nattyweb’s picture

Thanks @fietserwin for #28 - worked for me as a temporary fix. I'm using D7.56 and ImageCache Actions 7.x-1.7.

fietserwin’s picture

Issue summary: View changes