Hi,

I get various notices;

Notice: Use of undefined constant PRINT_TYPE_URLLIST_DEFAULT - assumed 'PRINT_TYPE_URLLIST_DEFAULT' in _print_url_list_enabled() (line 470 of /Users/itjh/workspace/zahak-dev-drupal/sites/all/modules/print/print.pages.inc
Notice: Uninitialized string offset: 0 in _print_rewrite_urls() (line 383 of /Users/itjh/workspace/zahak-dev-drupal/sites/all/modules/print/print.pages.inc).
Notice: Uninitialized string offset: 0 in _print_rewrite_urls() (line 401 of /Users/itjh/workspace/zahak-dev-drupal/sites/all/modules/print/print.pages.inc).

While performance loss i quite small, there is still a loss. Also, notices mix up coding of page, which is quite annoying when developing a new website. I'll fix a patch in a few minutes.

CommentFileSizeAuthor
#2 print-fix_notices-1579176-1.patch829 bytesZahak
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jcnventura’s picture

Wow, a bold tester... I'm glad you've taken the leap. However, there be sharks in these waters. The 7.x-2.x branch is in very uncharted territory nowadays (grep for @todo to see what I mean).

I'll wait for the patch, but I'd recommend the use of 7.x-1.x for any non-sandbox site. I'm not committing to any fixed date for the stable release of the 2.x branch.

Zahak’s picture

Status: Active » Needs review
FileSize
829 bytes

Patch killing killing notices on line 383 and 401.
Since I couldn't find any declaration of PRINT_TYPE_URLLIST_DEFAULT, and since it's new since 7.x-1.0 I assumed that it is a working progress and left it as it was.

Please notice that notices on line 383 and 401 was the main reason for me to create this issue, since they exist in 7.x-1.0 as well. However Drupal docs tells one to contrib to latest version (dev)?

My first contrib to Drupal world, so please let me know if I'm doing anything wrong. Starting small with a couple of notices ;)

jcnventura’s picture

Status: Needs review » Needs work

Under absolutely no circumstance should the code ever find that $url[0] is not set. Since you obviously know how to code, can you find out the content of the $matches variable on entry to that function? This fixes the symptoms, not the problem, and I'd prefer to fix the problem.

Indeed, you should always patch against the latest dev, but not necessarily the latest branch. It's OK if you patch against 7.x-1.x-dev..

Finally, about PRINT_TYPE_URLLIST_DEFAULT, it's currently called PRINT_UI_TYPE_URLLIST_DEFAULT, but I think I may need to change it back..

jcnventura’s picture

Oh, and thanks for contributing back to Drupal. I (and everyone else) appreciates it a lot!

Zahak’s picture

Ah, I see. Looked a bit further, and it appears when you have an empty href. Ehm... so well... don't really know if it should be announced as a bug in the module anymore ;)

jcnventura’s picture

It never occurred to me that someone with use an empty href.

I guess an extra check could be added in the 'do nothing' section for the case of empty($url).

Zahak’s picture

Well, empty href is highly unlikely. Blame my sandbox :)

jcnventura’s picture

Status: Needs work » Fixed

Fixed the empty href case in dev.

Status: Fixed » Closed (fixed)

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