Hey,

i got it now! after 3 hours of checking why this module not so work like i want (see http://drupal.org/node/1741960)..i found the bug.
the thing is if any one use a cdn for hosting jquery like google or msn this modul is only working under the admin..anonymous users are not able to klick the back_to_top button

any chance to fix it?
thanks

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

elgandoz’s picture

Same here. Using jquery update (jQuery 1.7 from Google).
In admin works.
Problem is Uncaught TypeError: Object #<Object> has no method 'easeOutQuart'

acke’s picture

Thanx for the report. I will look into it.

acke’s picture

Status: Active » Needs review

Hm. Back To Top uses a effect from jQuery UI (included in Drupal 7 core). When using Google CDN instead - it seems like that jQuery UI effect isn't loaded.

A quick fix is to add:

  drupal_add_js('//ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js');

before line 44 in back_to_top.module:

  drupal_add_library('system', 'effects');
laoguxintan’s picture

Warning: file_get_contents(//ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js) [function.file-get-contents]: failed to open stream: No such file or directory in _locale_parse_js_file() (line 1488 of /home/content/54/9662254/html/includes/locale.inc). Backtrace:
file_get_contents('//ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js') locale.inc:1488
_locale_parse_js_file('//ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js') locale.module:881
locale_js_alter(Array, NULL, NULL) module.inc:1049
drupal_alter('js', Array) common.inc:4163
drupal_get_js('footer') theme.inc:2600
template_process_html(Array, 'html') theme.inc:1106
theme('html', Array) common.inc:5787
drupal_render(Array) common.inc:5634
drupal_render_page('
acke’s picture

Status: Needs review » Closed (works as designed)

This is really a problem with jQuery update and now there's a patch for this:

http://drupal.org/node/1801388

maximpodorov’s picture

Status: Closed (works as designed) » Active

So adding the line

drupal_add_js('//ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js');

can be reverted now, right?

maximpodorov’s picture

Version: 7.x-1.3 » 7.x-1.x-dev
Status: Active » Needs review
FileSize
486 bytes

Please apply the patch which deletes the wrong line.

deanflory’s picture

Back to Top doesn't work once the patch to jquery_update is applied. Tried with and without the #7 patch above.

I've updated to the Sept 20 version of jquery_update on two sites. The one with jquery_update enabled to jQuery 1.7 works fine with the latest from each module. The other also has jquery_update enabled, set to v1.7, but I had tested the patches for both the back_to_top and jquery_update modules for this CDN issue, yet now it won't work, just getting these errors below, but I've reverted back to the un-patched versions and it's still the same:

Warning: file_get_contents(sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.effects.core.min.js) [function.file-get-contents]: failed to open stream: No such file or directory in drupal_build_js_cache() (line 4943 of /.../includes/common.inc).
Warning: file_get_contents(//ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js) [function.file-get-contents]: failed to open stream: No such file or directory in drupal_build_js_cache() (line 4943 of /.../includes/common.inc).

What has been altered outside of the module and how do I fix it?

While this may just be some fluke error during the update process or something, it really doesn't make sense since no database modifications were made during the update process.

Disabling and uninstalling jquery_update, then flushing cache twice still produced this error (new after enabling back_to_top), so it doesn't seem to be anything to do with the jquery_update module, but now that jquery_update is uninstalled the back_to_top functionality does work just annoys with this error:

Warning: file_get_contents(//ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js) [function.file-get-contents]: failed to open stream: No such file or directory in drupal_build_js_cache() (line 4943 of /.../includes/common.inc

I've found through further testing that the one site with the problems seems to allow back_to_top to work when there is no jquery_update enabled and when jquery_update is enabled and set to the default v1.5, but when jquery_update is changed to v1.7 and saved, back_to_top no longer functions as the button shows but clicking on it doesn't scroll back to the top. I have no idea what is going on since my other site is running jquery_update set to v1.7 and it's back_to_top is working perfectly fine except for the Warning error (both sites). Any ideas?

deanflory’s picture

The Sept 30 dev release of back_to_top or the latest dev release of jquery_update (2013-Oct-14, that has the patch mentioned in this issue applied/fixed in the dev version) fixed my issue with that one site's back_to_top not working. It's working now, but I'm still getting this one warning error on both sites:

Warning: file_get_contents(//ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js) [function.file-get-contents]: failed to open stream: No such file or directory in drupal_build_js_cache() (line 4943 of /.../includes/common.inc

Is it a problem with the formatting of the ajax.googleapis.com link? Missing an "http:" at the beginning or is that set that way to work for http: and https:? Does that need to be that way for an external file? When putting "http:" at the beginning of the URL in the error warning, it does indeed exist at that location.

Also, why are we needing to pull from an external source? Will the version that comes with jquery_update not suffice? Not overly keen on having a reliance on my site to any external sources.

The dev version of jquery_update presently comes with:
jQuery 1.5.1/1.7.1/1.8.2, 1.9.1, 1.10.2 and jQuery UI 1.10.1

Looking at the folder structure, the "jquery-ui.min.js" file is in the 1.10.1 version. Is there not an easy replacement using the file below or are serious changes to the module required to get it working with the newer version of jQuery UI?

sites/all/modules/jquery_update/replace/ui/ui/minified/jquery-ui.min.js

acke’s picture

Status: Needs review » Fixed

Thanx for the input and extra thanks to maximpodorov for the patch. This was a easy one! :) Committed and pushed to HEAD / -dev.

deanflory’s picture

Thanks all! Updating to the 7.x-1.x-dev 2013-Oct-15 version of back_to_top seems to have fixed the issue and I no longer am getting the error warning on both sites I'm working on at this time.

Status: Fixed » Closed (fixed)

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