warning: file_get_contents(themes/garland/popups-skin.js) [function.file-get-contents]: failed to open stream: No such file or directory in /home/cyberfan/htdocs/includes/locale.inc on line 1689.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dummas_324324_32’s picture

I have the same error and don`t know how to fix

ddffx’s picture

Version: 6.x-2.x-dev » 6.x-2.0-alpha5

I am getting the error page not found in admin/reports/dblog, the popups module is requesting popups-skin.js from the current theme folder when Unskinned option is selected in admin/settings/popups page. The code regarding this call is in line 309 of the function popups_add_popups in popups.module file.
Quoting line 307-311

    if (!$skins[$skin]['css']) { // $skin == 'Unskinned'
      // Look in the current theme for popups-skin.js
      drupal_add_js(drupal_get_path('theme', $theme) . '/popups-skin.js');
    }
    else .....
 

It does not make any sense why this line is for if we do not want any skin (unskinned). Also I could not find any such file (popups-skin.js) in the module directory for inclusion etc.
Any thought on this one?

AntiNSA’s picture

Priority: Normal » Critical

???

altparty’s picture

Same problem here. Just deleting the if-else construction only removes the error message. But still no content shows up.

awolfey’s picture

Comment out line 309 will fix it. I'm not sure why that is there. Can maybe look more later.

zarudnyi’s picture

Same problem here.

Manuel Garcia’s picture

Title: getting error about popups-skin.js... how can I fix this? » Unskinned should check if files exist before adding them
Version: 6.x-2.0-alpha5 » 6.x-2.x-dev
Status: Active » Needs review
FileSize
10.33 KB

I think it is also missing a part to add the css file. In both cases it should check if the file exists already before trying to add it.

I've made a patch against the 2.x dev, and btw, 1.x branch also has this problem.

Manuel Garcia’s picture

Oops, ignore the previous patch, use this one.

What I suggest is that we change that line to this:

      // Look in the current theme for popups-skin.js
      $theme_js = drupal_get_path('theme', $theme) . '/popups-skin.js';
      if(file_exists($theme_js)) {
        drupal_add_js($theme_css);
      }
      // Look in the current theme for popups-skin.css
      $theme_css = drupal_get_path('theme', $theme) . '/popups-skin.css';
      if(file_exists($theme_css)) {
        drupal_add_js($theme_css);
      }

This way if theres a css file in the current theme it also gets added, which is nice and helpful. I have tested with css file and it works great =)

Manuel Garcia’s picture

FileSize
10.33 KB

NOt my day, forgot to attach the patch

JGO’s picture

Indeed, suffered from the same. Please fix!

JGO’s picture

Come on, we are a year later. Just updated the module and still suffering from this problem :(

HongPong’s picture

still the same problem here

HongPong’s picture

Alright here is another patch based on Manuel Garcia's with the same basic thing, only now it works in git with the new CVS headers out.
I really think this should be committed now. I also fixed a typo in comments.

Also I think the js should only be added, not CSS at that point? That's the difference between garcia and mine...

-      drupal_add_js(drupal_get_path('theme', $theme) . '/popups-skin.js');
+      $theme_js = drupal_get_path('theme', $theme) . '/popups-skin.js';
+    if(file_exists($theme_js)) {
+      drupal_add_js($theme_js);
+      }
+    // Look in the current theme for popups-skin.css
+      $theme_css = drupal_get_path('theme', $theme) . '/popups-skin.css';
+      if(file_exists($theme_css)) {
+        drupal_add_css($theme_css);
+      } 
drewish’s picture

There's some definitely formatting issues. I'll try applying it on monday and see how it functions.

GiorgosK’s picture

Status: Needs review » Reviewed & tested by the community

Manually applied the patch (netbeans would not apply it)
and it works as expected please commit

JGO’s picture

Updated the module to beta0 and suffered again from this problem lol. How long does this take to fix ? :p

GiorgosK’s picture

@JGO try the patch and report if it solves your problem
that is the way an issue can get resolved and get committed for the next release

right now its at the RTBC and if maintainer takes notice he will probably include it in the next release

drewish’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
937 bytes

How does this look? I committed the spelling corrections separately, stripped out the whitespace changes, and fixed the formatting.

jlporter’s picture

Status: Needs review » Reviewed & tested by the community

@ #18 good patch Drewish, worked with git apply and fixed the problem. Let's get this patch applied :)

mattcasey’s picture

This is still an issue, thanks for the patch. It works great

JGO’s picture

Indeed, the patch fixed my issues too. Please implement ;)

chinita7’s picture

#18 fixed also my problem Thanks.

amaisano’s picture

Issue summary: View changes

RTBC? At least to the dev version?