Hello,

I'm testing your wonderful module. :)
The following error message appears after module installation:

Notice: Use of undefined constant LOCALE_LANGUAGE_NEGOTIATION_URL_PREFIX - assumed 'LOCALE_LANGUAGE_NEGOTIATION_URL_PREFIX' in ajax_pages_init() (on line 52 in all/modules/ajax_pages/ajax_pages.module).

It seems to collide with the "locale" core module. When I disable it, the error message disappears.

Best regards!

CommentFileSizeAuthor
#1 ajax_pages-locale-2062461-1.patch1.51 KBjamix

Comments

jamix’s picture

Assigned: Unassigned » jamix
Category: support » bug
Status: Active » Needs review
StatusFileSize
new1.51 KB

Thank you for reporting this. The constant is declared in locale.inc, and that file is included in locale_init(). The problem is that ajax_pages_init() is called before locale_init() and so LOCALE_LANGUAGE_NEGOTIATION_URL_PREFIX is not yet declared by then.

We could adjust the module weight for Ajax pages so that its hook_init() implementation would run after that of the Locale module but that breaks a few other things, notably the hook_page_delivery_callback_alter() implementation when the Boost module is enabled. So I decided to force-include locale.inc in ajax_pages_init() instead.

Please try the attached patch.

design.er’s picture

Status: Needs review » Fixed

Sorry for the delayed reply - I've been completely snowed under with work for the last weeks.
Your patch works like a charm. I tested it with and without "Locale" module -> no errors and everything works fine! Thank you very much for the quick fix. I'm looking forward to use it for my next project.

Sorry for the off-topic: do you plan to upgrade your module to Drupal 8 or are there any core solutions for ajax-driven navigation that would make an upgrade unnecessary?

Status: Fixed » Closed (fixed)

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

jamix’s picture

Committed and pushed to 7.x-1.x. Thank you!

As far as the Drupal 8 version goes, I haven't explored porting the module to Drupal 8 yet so I'm afraid I don't have anything to say at this point.