ckeditor_help_delegate($path) does something like:

// On *all* pages :
if (ckeditor_path('local') != '<URL>') {
  $do_not_touch_configjs = '<p>' . t('It is recommended to not edit the !ckeditor_config_file .... [long string]').
}
switch ($path) {
  // On a couple specific paths, return some help text.
  // *One* case uses the $do_not_touch_configjs string prepared above
}

That results in the t() call being executed on every single page view. Since the string is longer than 75 chars, it is not cached in the locales cache, and executing that t() call results in a needless db query for the translation, on every page.

CommentFileSizeAuthor
#2 2367913-useless_locale_query-2.patch2.23 KByched

Comments

yched’s picture

Title: ckeditor_help() issues one uncached db query on each page » ckeditor_help() issues one uncached locale query on each page

More specifically, that affects sites:
- whith locale.module enabled
- that use a locally downloaded version of the ck library.

yched’s picture

Status: Active » Needs review
StatusFileSize
new2.23 KB

Patch moves the code around to only compute the variables in the case/switch branch that actually needs them.

jcisio’s picture

Status: Needs review » Fixed

Looks good. Committed and pushed. Thanks.

  • jcisio committed 8499587 on 7.x-1.x authored by yched
    Issue #2367913 by yched: Fixed ckeditor_help() issues one uncached...

Status: Fixed » Closed (fixed)

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