I have updated the module from 2.1 to 2.2

I have now several errors in the logs:
Nachricht Warning: file_get_contents(http://www.xxx/sites/default/files/js/wysiwyg/wysiwyg_ckeditor_uWMoMQ7qlhtyf-cFJlMTazsAxhCeS88weKBiAtXujAQ.js) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in drupal_build_js_cache() (Zeile 4846 von /xxxx/www/includes/common.inc).

and

Nachricht Warning: file_get_contents() [function.file-get-contents]: http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in drupal_build_js_cache() (Zeile 4846 von /is/xxxx/www/includes/common.inc).

CommentFileSizeAuthor
#4 wysiwyg-1802394-4.patch468 bytesTwoD
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Goekmen’s picture

Title: Warning: file_get_contents from 2.1 to 2.2 » Warning: file_get_contents from 7.2.1 to 7.2.2
funtik44’s picture

sub

TwoD’s picture

This happens because Wysiwyg now dynamically generates a small script file and loads it before the library scripts to be able to set things like an editor's base path properties.

The generated file in itself does not cause the problem, but it does not get included properly in the aggregated script file Drupal creates for the optimization. The generated file is placed in public://js/wysiwyg/wysiwyg_EDITOR_HASH.js and Drupal should have recognized that it is a local file instead of trying to fetch it via HTTP from itself (which isn't allowed since your server has allow_url_fopen=0.

A quick workaround, with the implied performance penalties, would be to disable JavaScript Optimization on the Performance page while we're looking into this.

Note: The warning is annoying but mostly harmless. It should only be able to cause any problems when using editors that have been loaded via AJAX, like with the Panels in-place editor, because Wysiwyg is no longer able to tell the editor where to load its internal files from.
Update: This would also cause problems in locale module since it tries to parse script files as well.

TwoD’s picture

Status: Active » Needs review
FileSize
468 bytes

Here's a simple fix.
There was no need for the file_create_url() call because drupal_add_js() supports stream wrappers.

Can you please verify this change removes the warnings for you too?

Goekmen’s picture

The warnings are gone, thank you!

sun’s picture

Status: Needs review » Fixed

Thanks for reporting, reviewing, and testing! Committed to 7.x-2.x.

A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.

Status: Fixed » Closed (fixed)

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

helmo’s picture

Title: Warning: file_get_contents from 7.2.1 to 7.2.2 » Warning: file_get_contents from 7.x-2.1 to 7.x-2.2

Updated the somewhat misleading version numbers in the title.

jerdavis’s picture

Status: Closed (fixed) » Active

Can we please get another official release of the module that includes this fix?

TwoD’s picture

Status: Active » Closed (fixed)

Please look for issues like #1838100: Time for a 7.x-2.3 release? rather than re-opening individual ones.

artfulrobot’s picture

Status: Closed (fixed) » Active

Hmm. I've updated to the dev version but I still get this problem (base path not set to the correct location of CKEDITOR).

I'm using aggregation and my app uses push/pop state to change the URL. CKEDITOR seems to take the latest URL as the base path, which is daft.

Hope setting this to "active" was the right thing to do. Perhaps you think it's a separate issue? I note the comment in the code "this won't work with ajax" line 387 of wysiwgy.module.

artfulrobot’s picture

Status: Active » Closed (fixed)

Hmm. Sorry, don't think it's a bug in this module. Something breaks when you turn aggregation on with ckeditor.

heathdutton’s picture

Can confirm this issue with 7.x-2.2 when JS aggregation is enabled.

carn1x’s picture

Issue summary: View changes

I get this with aggregation turned off on 7.x-2.2

TwoD’s picture

@heatdutton, 8.x-2.2 doesn't exist.

@carn1x, read the conversation please. This was fixed in 7.x-2.x-dev long ago.

illmatix’s picture

Version: 7.x-2.2 » 7.x-2.x-dev

I updated to 7.x-2.x-dev after noticing this error last week, but it still throws the same error. In my case here we're using wysiwyg inside a collapsible paragraphs field and using s3fs. I have updated paragraphs to the newest version and as I mentioned the most recent dev version of wysiwyg. As far as I can see JS aggregation is off.

On further inspection, it shows the file at /js/wysiwyg/wysiwyg_ckeditor_.js isn't getting created.

carolpettirossi’s picture

Status: Closed (fixed) » Needs review

I'm using 2.2 version and the patch is not applied yet.

I've applied the suggested patch and the warning is not appearing.

TwoD’s picture

Status: Needs review » Closed (fixed)

The patch was applied in 7.x-2.x-dev long ago and will thus be part of 7.x-2.3.
7.x-2.2 won't ever change as it's a tag on a specific commit in the git history. 7.x-2.3 will be a new tag at a later date.