I installed this module and everything seems to work fine except that, i get an error msg:
Notice: Undefined variable: extension in DownloadLinks->_download_link_labeler_replace_callback() (line 139 of /home/test/sites/all/modules/contrib/download_link_labeler/download_link_labeler.module)
i'm running Drupal 7.64 with PHP 7.2.x
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | download_link_labeler-3040300-9.patch | 494 bytes | daiwik.addweb |
Comments
Comment #2
matthandI will troubleshoot this bug soon. Thank you for bringing it to my attention.
Comment #4
matthandI just pushed an update to the 7.x branch with a bugfix for local files containing spaces and other special characters in the filename. Previously, a URL Encoded filename was passed to the local file functions being used by PHP, instead of the actual decoded filename. If this doesn't fix your issue, can you please give me more details?
What is the href of the link you are adding labels to?
Do you have any extra spaces or commas or any odd characters in the settings configuration form?
Thanks for helping me out by providing your use case!
Comment #6
onejam commentedJust tested your new update. Thanks for that. But still showing same error though now it says error on line 140 instead.
The link is to a pdf file:
<a href="/sites/default/files/content-uploads/pdf/europe-2018_book.pdf" target="_blank">Europe 2018 Book</a>Please note, the link renders fine and the download labeller is working as expected. It is just the error msg i get when viewing the page that renders the link to add the label and file size info.
Comment #7
matthandOkay, I'm having trouble reproducing the bug. I'm glad it works, but I certainly do not want my module throwing errors!
Can you double check your Text Format configuration form? Did you change the configuration at all to include more filename extensions? It would be in the fieldset labeled "filter settings" at the bottom of the text format settings page, like this form for the "full html" text format at the path: /admin/config/content/formats/full_html
I'll continue to review the code that sets the $extension variable to try to find the bug.
Comment #8
matthandHi again... Can you test the 7.x-dev release version? I think I have your bug fixed. I still can't replicate your issue though. So I really need your help to test. Thank you!
Comment #9
daiwik.addweb commented@duvien, kindly review the below-attached patch where I Defined variable when the function starts to resolve the seen notice error.
Thanks!
Comment #10
matthandBug fixed in last Drupal 7 release.