If the downloadcounter shows one or more downloads, i get this message:

    * Notice: Use of undefined constant LANGUAGE_NEGOTIATION_NONE - assumed 'LANGUAGE_NEGOTIATION_NONE' in _pubdlcnt_language_prefix() (Zeile 1382 von /home/www/----/html/dev/sites/all/modules/pubdlcnt/pubdlcnt.module).
    * Notice: Use of undefined constant LANGUAGE_NEGOTIATION_NONE - assumed 'LANGUAGE_NEGOTIATION_NONE' in _pubdlcnt_language_prefix() (Zeile 1382 von /home/www/----/html/dev/sites/all/modules/pubdlcnt/pubdlcnt.module).

I think there is just a language string missing. I am using Drupal 7 with german language.

Comments

pixture’s picture

language negotiation stuff seems to be changed with D7. Since I've been testing it with English only D7 environment, I did not notice it. I will be looking into it. Meantime, change the code below should temporary fix the issue.

Before

/**
 * Returns languae prefix
 */
function _pubdlcnt_language_prefix() {
  global $language;

  if ($language->prefix != '' && variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE) != LANGUAGE_NEGOTIATION_NONE) {
    return $language->prefix . '/';
  }
  return '';
}

After

/**
 * Returns languae prefix
 */
function _pubdlcnt_language_prefix() {
  global $language;

  if ($language->prefix != '') {
    return $language->prefix . '/';
  }
  return '';
}

Thanks,

Dalabad’s picture

Thanks, the fix works fine.

olamaekle’s picture

Thanks. Worked for me too.

resist’s picture

Thank you, works for me too.

emnzava’s picture

It doesn't work on my side. I looked at the file and it seems to be updated with the patch but still problem persist.

Regards

white_pawn’s picture

LANGUAGE_NEGOTIATION_NONE is a D6 leftover. The same variable is called LANGUAGE_NONE in D7. Just rename it and it should work.

white_pawn’s picture

Status: Active » Needs review
hgneng’s picture

@white_pawn

I think renaming LANGUAGE_NEGOTIATION_NONE to LANGUAGE_NEGOTIATION_DEFAULT may be a better way.

Reference:
http://api.drupal.org/api/drupal/includes%21language.inc/7

phthao’s picture

I Thank #pixture!

phily’s picture

Thanks, that works.

But then, on the report page: http://website.dev/admin/reports/pubdlcnt
the "Detail" link url displays the default language prefix: http://website.dev/fr/admin/reports/pubdlcnt/counter/xxx.pdf
when it shouldn't: http://website.dev/admin/reports/pubdlcnt/counter/xxx.pdf

And the same occurs for "Title", "Field Name" and "Reset" links.

Could that help fixing something?

nothinghere’s picture

Patch in #1 seem to fix the issue for me ! Thank you !

warmth’s picture

Any news on this issue?

AmbikaFR’s picture

StatusFileSize
new636 bytes

I a attach a patch with my answer. It replaces LANGUAGE_NEGOTIATION_NONE to LANGUAGE_NEGOTIATION_DEFAULT.

Regards,

AmbikaFR.

uhkis’s picture

Issue summary: View changes
StatusFileSize
new598 bytes

Fixed patch. Same as #14 but applies from the module's directory as it should.

nicolas bouteille’s picture

Status: Needs review » Active

Errors go away thanks to your patch !
Applied manually though. Might need to be tested with GIT before RTBC...

nicolas bouteille’s picture

Status: Active » Needs review

sorry I selected active instead of needs review after changing my mind about marking RTBC