Running on Drupal 6.14 with CCK 6.x-2.6.
A field added to my content-type doesn't throw an error message or refuse validating when entering an isbn with less than 13 digits (example: 9783940666). It also doesn't refuse validating when entering a wrong isbn number (with wrong last digit like 9783940666049).
Anything I missed when installing?
I activated both the simple validation and the AJAX-validation. AJAX-validation just gave me and endless spinner in the input field.

CommentFileSizeAuthor
#1 isbn.module.patch1.49 KBkatrienc
#1 isbn_attach.js_.patch902 byteskatrienc

Comments

katrienc’s picture

StatusFileSize
new902 bytes
new1.49 KB

I've created a patch to solve these 2 problems.

katrienc’s picture

Status: Active » Needs review

changed the status to needs review

reglogge’s picture

Status: Needs review » Needs work

Validation without JavaScript works fine now, thanks!

Validation with JavaScript works during input of ISBN-numbers. However, when saving the node I get these error-messages:

    * warning: file_get_contents(sites/all/modules/isbn/isbn.js) [function.file-get-contents]: failed to open stream: No such file or directory in /htdocs/drupal/includes/locale.inc on line 1689.
    * warning: file_get_contents(sites/all/modules/isbn/isbn.js) [function.file-get-contents]: failed to open stream: No such file or directory in /htdocs/drupal/includes/common.inc on line 2402.

Drupal seems to look for a file isbn.js which isn't there in the module.

reglogge’s picture

I think this is the function from isbn.module that causes the problem:

function isbn_dynamic_validation() {
  static $complete = FALSE;
  global $user;
  // Only need to do once per page.
  if (!$complete) {
    drupal_add_js(drupal_get_path('module', 'isbn') .'/isbn.js', 'module');
    drupal_add_js(drupal_get_path('module', 'isbn') .'/isbn_attach.js', 'module');

    drupal_add_js(array(
      'isbn' => array(
        'validateURL' => url('isbn/validate'),
        'confirmSuccess' => t('Valid ISBN/ISSN number.'),
        'confirmFailure' => t('Not a valid ISBN/ISSN Number.'), 
        'notEnoughDigits' => t('Not Enough Digits!  '),
        'tooManyDigits' => t('Too Many Digits!  '),
        'requiredDigits' => t(' digits are required.'),
        'missingPrefix13' => t('13 Digit ISBNs need to begin with 978 or 979.'),
    )), 'setting');
    $complete = TRUE;
  }
 

}
katrienc’s picture

That's true. That's also the reason why I opened the issue on http://drupal.org/node/687924 and created a patch that removes the isbn.js script that doesn't exists.

zbricoleur’s picture

Status: Needs work » Fixed

Fixed in alpha3. Thanks lot007!

Status: Fixed » Closed (fixed)

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