Awesome module, first off.

Anyway, not sure if its just me but when browsing fonts, after clicking next or a pager beyond the first page in the UI, the fonts don't preview except for bold variants however otherwise they all look like the same font. Tried this in both Safari and Firefox with same results. I did find, however, that if I drill down into a specific font and click the preview to see how it looks in a sentence, then it does render the preview of the font correctly.

Screenshot attached. Thanks!

Note: if you're getting an AJAX error (rather than missing font previews), use a different issue: #1376686: Error with Ajax enabled views in admin overlay for jQuery 1.7 and Views 3

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

BarisW’s picture

Status: Active » Postponed (maintainer needs more info)
FileSize
62.03 KB

You might try to revert the View. I cannot reproduce the problem you have; tried in Safari and Crome and it works fine.

Reverting views

Please let me know if this solves your problem.

ret5’s picture

Thanks for the quick reply. Views settings were as you pointed out. However I just figured out that by disabling ajax in the view, problem solved.

Lloyd’s picture

When I browse to a subsequent page to view fonts, I get an ajax overlay error message. I'm thinking this could be related.

sreynen’s picture

Lloyd, can you upload a screenshot of the error you're seeing?

NancyDru’s picture

Here's my error:

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /views/ajax?render=overlay
StatusText: OK
ResponseText: @import url("http://brooke/modules/system/system.base.css?lxjlxx");
@import url("http://brooke/modules/system/system.menus.css?lxjlxx");
@import url("http://brooke/modules/system/system.messages.css?lxjlxx");
@import url("http://brooke/modules/system/system.theme.css?lxjlxx");
@import url("http://brooke/modules/overlay/overlay-child.css?lxjlxx");
@import url("http://brooke/modules/comment/comment.css?lxjlxx");
@import url("http://brooke/modules/field/theme/field.css?lxjlxx");
@import url("http://brooke/modules/node/node.css?lxjlxx");
@import url("http://brooke/modules/search/search.css?lxjlxx");
@import url("http://brooke/modules/user/user.css?lxjlxx");
@import url("http://brooke/sites/all/modules/views/css/views.css?lxjlxx");
@import url("http://brooke/sites/all/modules/ctools/css/ctools.css?lxjlxx");
@import url("http://brooke/sites/all/modules/extlink/extlink.css?lxjlxx");
@import url("http://brooke/sites/all/modules/admin_menu/admin_menu.css?lxjlxx");
@import url("http://brooke/sites/all/modules/admin_menu/admin_menu.uid1.css?lxjlxx");
@import url("http://brooke/sites/all/modules/fontyourface/modules/fontyourface_ui/css/fontyourface_ui.css?lxjlxx");
@import url("http://brooke/themes/seven/reset.css?lxjlxx");
@import url("http://brooke/themes/seven/style.css?lxjlxx");
sreynen’s picture

Can you please list the steps that led to that error?

NancyDru’s picture

Refreshed Google Fonts (the only one enabled). Probably not needed.

Went to Appearance >> @font-your-face >> Browse

Scroll to next page. Can also be done by starting to type in a font name.

NancyDru’s picture

#2 fixed it for me too ("Advanced settings").

BarisW’s picture

Happens with me as well, but only when Overlay is enabled. If Overlay is switched off, all works fine.

sreynen’s picture

Status: Postponed (maintainer needs more info) » Active

I'm no longer waiting for more info, just time to look into this more.

NancyDru’s picture

I'm guessing that the easiest thing to do is to change the view to not use Ajax.

sreynen’s picture

Title: Font styles do not preview after first page in views UI » Font styles do not preview after first page in Views UI with AJAX

On further research, I think there are two separate issues here.

First problem: font CSS doesn't load on AJAX page loads. I think BarisW (and myself) are normally seeing fonts load fine without the CSS because we're spending a lot of time loading pages of fonts, so we have a lot of the font files already cached and don't need the CSS to get the files again. But the CSS is loaded in template_preprocess_page(), which doesn't run on AJAX calls, since there's no page to preprocess. The solution to this is to add the CSS to the AJAX response with hook_ajax_render_alter(), which we're already doing for Fonts.com browsing. That will need to be done separately for each provider, though, since they all add CSS in a slightly different way. Until it's fixed, the work-around is to turn off AJAX on Views.

Second problem: the error in #5. I didn't see this at all when I was on Views 7.x-3.0-rc3, but I now see it after updating to Views 7.x-3.0, all running the same version of @font-your-face. It looks like there's already an issue for this in the Views queue #1376686: Error with Ajax enabled views in admin overlay for jQuery 1.7 and Views 3. I'm expecting this to be resolved in Views, and will follow that to confirm the fix doesn't require any changes to @font-your-face.

vinotwit’s picture

#2 worked for me to. Error happened after a Fontyourface upgrade from 7.1.4 to 7.2. Turning off Ajax in the Fontyourface view solved the problem. Thanks!

sreynen’s picture

Status: Active » Needs review

I've committed to the dev branch a potential fix for this and would appreciate people testing it to confirm it solves the rendering problem.

I think I found a simpler solution than what I was thinking in #12. Rather than give each provider a separate hook_ajax_render_alter() function, I just added a single function in the main module and called the existing template_preprocess_page() functions from there to get the various CSS.

BarisW’s picture

Status: Needs review » Needs work
FileSize
113.31 KB

It works, but only with Overlay disabled. If you enable Overlay, you get a huge Javascript error.

sreynen’s picture

Status: Needs work » Needs review

That's the error in #1376686: Error with Ajax enabled views in admin overlay for jQuery 1.7 and Views 3. That needs to be fixed in Views, but there's a temporary work-around here:

http://drupal.org/node/1376686#comment-5466256

westbywest’s picture

@sreynen I upgraded to views 7.x-3.1, and to fontyourface 7.x-2.x-dev dated 18 Jan 2012, and I still must disable the overlay module to enable any fonts. I verified that the copy of ajax_views.js provided with views 7.x-3.1 has the patch mentioned in the comment you linked to.

I am also unable to disable AJAX in the view provided with the fontyourmodule module, since attempting to save the modified view yields this error:

No valid values found on filter: Font: Provider.

sreynen’s picture

westbywest, please provide more specific details on "I still must disable the overlay module to enable any fonts." Why must you do that?

The error you saw when turning off the AJAX is a separate problem, so please open a separate issue for it.

westbywest’s picture

FileSize
110.76 KB

@sreynen Sorry for being vague. I get an AJAX/JS error popup when either typing a font name into the field to filter the list while browsing fonts, or when I click any link on the pager at the bottom of the font list, similar to that pictured in #15. This only happens when the core overlay module is enabled.

I tried upgrading to views v3.1, which does have the change to ajax_view.js suggested as workaround on this comment you referenced:
http://drupal.org/node/1376686#comment-5466256

UPDATE: on comment #21 on that same thread, this patch to ajax_view.js is proposed, which fixes the AJAX/JS error popup pictured.
http://drupal.org/node/1376686#comment-5481488
http://drupal.org/files/views-overlay-mess-1376686-21.patch

The browse fonts page in fontyourface now works w/o error with overlay module enabled. The only side-effect I notice from this patch is that clicking the "Reset" button in the filter controls for the font browser seems to bypass the overlay module UI and switch to a default theme (Bartik). The front-end theme is unaffected.

ewlyn’s picture

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

I'm getting the same AJAX error when attempting to switch pages, search by name, or sort when I have everything up in an overlay. Basically, if I try to navigate to any page other than the initial page it shows me, I get the same error everyone else is getting:

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /views/ajax?render=overlay
StatusText: OK

And then a huge list of @import url followed by mostly everything related to my Drupal install.

Oddly, if I go into the FontYourFace view everything works fine in the preview window. Ditto if I do not access it in an overlay.

I turned off AJAX under advanced in the view and that seems to have resolved it. If there is any additional info I can give or screen caps or anything to help resolve this, please let me know. I'm a designer, not a developer, or I would offer to try to help resolve it.

This is one of the most useful modules for me as a designer. I adore it.

sreynen’s picture

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

I added a note to the top of this post pointing to the AJAX error issue, which is different from the preview problem this issue is here to address. If someone can review the dev release and confirm the preview problem is fixed there, that would be helpful.

sammyframson’s picture

Thank you for the link to the other issue queue... I applied the patch in comment #21 and it fixed my AJAX Errors:

http://drupal.org/node/1376686#comment-5481488

mr.marlin’s picture

i get the same error. In the Views, setting AJAX to "off" corrected the issue.

sreynen’s picture

Status: Needs review » Fixed

This has been awaiting review of the -dev version for over a month, so I'm going to call it fixed and try to get a new release out soon. If anyone is still having the preview failure problem with the forthcoming 7.x-2.1 release, please re-open this.

Status: Fixed » Closed (fixed)

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

ret5’s picture

Version: 7.x-2.x-dev » 7.x-2.7
Status: Closed (fixed) » Active

Hello - This issue seems to have resurfaced in the latest build (7.x-2.7). Disabling ajax in the view solves but thought I'd point it out.

Thanks!

Drave Robber’s picture

Not exactly 'resurfaced' - to my knowledge, it's been there all the time. This was also the reason why I pushed for disabling AJAX in #1810308: Please disable autosubmit for font browsing (and also maybe turn off AJAX).

mengi’s picture

I am having trouble with the fontyourface browser. Only have google fonts enabled.

I turned off AJAX in the view and flushed caches repeatedly, but it seems the view is still using AJAX. If I right click on the pager and open in a new tab, then it works as intended (Correct font is displayed and URL changes to show what page I am on).

Searching for font's doesn't show the correct font either.

liza’s picture

Preview of fonts in browse is still completely broken for me and I've noticed FYF doesn't have a view page for each font-provider. It defaults to either fontsquirrel or Google Fonts and doesn't show either in the aggregate.

liza’s picture

Issue summary: View changes

Link to other issue mixed up in this thread.

Neslee Canil Pinto’s picture

Issue summary: View changes
Status: Active » Closed (outdated)