Closed (fixed)
Project:
Quail API
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
11 Jan 2012 at 20:33 UTC
Updated:
27 Feb 2012 at 19:40 UTC
Jump to comment: Most recent file
The module appears to be correctly scanning the page and producing reasonable results; however, it doesn't actually display source line/element information. A screen shot illustrating the problem is attached.
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | qual_api-7.x-1.x-dev-updates-1.patch | 1.28 KB | thekevinday |
| #16 | quail_api-debug-data-1401844-15.txt | 16.17 KB | jerry |
| #15 | quail_api-watchdog_debug_statements-1.patch | 3.09 KB | thekevinday |
| #3 | quail_api-issue_1401844-1.patch | 1.08 KB | thekevinday |
| #2 | na-noline2.png | 149.41 KB | jerry |
Comments
Comment #1
thekevinday commentedWell this is weird.
This at first looks like it is happening somewhere in the quail_api_problem generation process from the quail api module itself.
As the data is directly from the php quail library, I might be missing some step to properly handling the data with drupal.
In the quail_api.module file (in the function template_preprocess_quail_api_problem()), I am calling check_markup() against the code.
$variables['markup_format'] is getting passed to it from the theme function.
This points me back to node_accessibility.
What markup format have you using for the content type in question?
I will have to spend some more time snooping around to see how exactly I am passing the markup around between quail_api and node_accessibility.
Comment #2
jerry commentedThe markup format is full_html.
I dumped the contents of $variables just before the first unset() at the end of template_preprocess_quail_api_problem() (see attached), and the element data is indeed being passed in, but the line data is not, so the problem_line and problem_description items remain empty.
Versions: quail-lib 0.4.1 with your patches from the Quail API module installed, Quail API 7.x-1.0-alpha1, and Node Accessibility 7.x-1.0-alpha1.
(Thanks for the quick attention to the report.)
Comment #3
thekevinday commentedI think I found the problem to be a logic mistake on my part.
In the quail_api module, I have the following code:
The problem here is that I was using the php function empty().
Based on the line number data from your debug output, the line number is 0.
The empty() function treats the numerical value of 0 as empty.
Which means the code does not get displayed..
The attached patch changes the !empty() calls in the said function into isset() calls.
Change the status to "Reviewed and tested by the community" if the attached patch fixes the problem.
Comment #4
jerry commentedLooks like a partial fix; thanks. The patch failed to apply; I had to add a space before the opening brace on each of the three updated if conditions to match your original. After that, it applied fine, and the problematic code elements were displayed as intended. However, all problems on all pages were listed as line 0, so it looks as though that data's not being reported as expected from quail-lib (or perhaps got lost on the way to the theme function).
Comment #6
thekevinday commented#3: quail_api-issue_1401844-1.patch queued for re-testing.
Comment #8
thekevinday commentedThe patch is against the 7.x-1.x-dev branch.
I have committed the attached patch, so you can use the development branch as the starting point for further patches.
I am starting to consider that the line number = 0 part of the issue may be a mysql bug.
I am wondering what the contents of the node_accessibility_problems table looks like in your database.
The line # is pulled directly from the quail php library and stored in the database such that validation does not have to repeatedly happen everytime the accessibility validation results are viewed.
If the line numbers are all 0, then that probably means the problem happens on INSERT/UPDATE or before it.
If the line numbers are not all 0, then that probably means the problems happens on SELECT or after pulling the data from the database.
Comment #9
jerry commentedOK, I've switched to the dev branch for both quail_api and node_accessibility.
That table is, in fact, empty.
Comment #10
thekevinday commentedI created a bare d7 server with only node_accessibility and its dependencies using a mysql database.
I was not able to reproduce the problem you mentioned in #4.
What validations method have you tried?
Does the problem happen in all of them?
Also, try re-installing the quail_api and node_accessibility modules.
Perhaps the switching from 7.x-alpha1 to 7.x-dev may have caused some weird glitch.
Comment #11
jerry commentedI was originally using Section 508 and WCAG 2.0 a. I just ran through and tried all of them individually, and each exhibits the line 0 problem. I did note that validations for WCAG 1.0 aa and WCAG 1.0 aaa executed very slowly, for what it's worth.
I already did so, and installed the dev modules from scratch on a separate site. Both old and new sites continue to lack line number information.
One possible common denominator, however, is the quail-lib code itself. As I'd applied your quail-bug_fixes.patch to it, I simply copied that to the new site from the old one. I just downloaded a fresh copy of quail-lib 0.4.1 to the new site and tested it via node_accessibility without patching. It produced a PHP warning and also failed to display line numbers. I then applied the patch, which removed the warning but didn't affect the line number problem.
Is there anything else that I can do on this end that would be helpful in tracking it down?
Comment #12
thekevinday commentedThis just seems to get harder and harder to figure out whats wrong.
Which of the following are you using?
- "Immediately validate"
- "Manually Validate"
- "Immediately Validate & Save"
- "Manually Validate & Save"
What concerns me is that the "Save" choices above are the ones that save to the database.
If the others are being used, then the database would be empty.
If you are using the non-save ones, then we can rule out any sort of SQL/database issues and focus on whats left.
Okay, I doubt this information will help me, but I might as well ask.
What OS are you using?
What php version are you using?
What mysql version are you using?
What version of drupal are you using?
Are any other modules other than core modules and node accessibility dependencies enabled?
If so, what are they?
One thing I could do is make a custom patch that logs a lot of the information where I could guess the problems might occur.
If I do that, I could then ask for a watchdog log dump...that sounds like something I should write and add to my cf module.
It would be very handy to dump specific parts of the watchdog to an export file of some sort.
Comment #13
jerry commentedI've tried all of these. I tried the "Save" variants when I was checking the contents of the node_accessibility_problems table, but for most testing, I'm using "Immediately Validate". All exhibit the same missing-line-number behavior, and as noted earlier, the "Save" variants didn't appear to actually save anything to the table.
CentOS 5.7 x86_64
5.2.17-1.el5
5.0.77
7.10
Administration menu 7.x-3.0-rc1
Chaos tool suite (ctools) 7.x-1.0-rc1
Coder 7.x-1.0
Colorbox 7.x-1.2
Devel 7.x-1.2
Entity API 7.x-1.0-rc1
Grammar Parser Library 7.x-1.x-dev (2011-Aug-18)
Rules 7.x-2.0
Ubercart 7.x-3.0-rc3
Ubercart Authorize.Net SIM/DPM Payment Methods 7.x-1.2
Views 7.x-3.1
I did, however, just disable all of these on my test site without affecting the line number problem.
I'd be happy to work with you to test that either way. Thanks.
Comment #14
thekevinday commentedI shall do that, I haven't been able to get back to this issue this week, but I should be able to to either this weekend or early next week.
Comment #15
thekevinday commentedHere is the debug patch.
Comment #16
jerry commentedAttached are the watchdog results, in chronological order, for immediate validation of a page using Section 508 and WCAG V2a on full HTML.
Comment #17
thekevinday commentedFor some reason the 7.x-1.x-dev release is a couple of commits behind and it never regenerated it.
Here is a patch that you can try, it does fix A problem with the total test failures being reported but I have doubts that it is THE problem you are having.
With any luck this patch solves your problem.
Comment #18
jerry commentedThanks.
I've applied the patch and re-tested. Unfortunately, the line-number-zero issue remains.
Comment #19
thekevinday commentedAfter review everything I am getting from this bug report states that (after the bugs where fixed in 7.x-1.x), the line #0 is exactly what the quail library is reporting.
This points to a potential bug in quail library.
However, I am entertaining the idea that how the data is being sent to quail library could be part of the problem.
The current approach is to take the renderred output and scan that so that after all modules and theme hooks do their thing the content that gets validated is not what is written by the node author but instead what the end-user will see.
With that in mind, what I believe may be happening is that the renderred output is producing output in such a way that confuses the quail library.
Of particular note is that the code printed in the debug statements is incomplete. The closing tags are missing!
This could be an issue in how the quail library returns the data.
There is a known issue where quail library strips out all of the html markup when providing data about a table, making their output example completely useless in my opinion.
I am also curious as to the line numbering system you are hoping to get results from.
I am surprised this did not occur to me until now, but perhaps the line number in the code/editor area is what you are looking for, but the renderred output is what gets scanned.
What this all means is that I think the remaining problem is with quail library and not with either of my projects.
This also means that the logic in handling the quail library could be improved, somehow.
I intent to close this as fixed because there were problems fixed and then I suggest you open a feature request in the node accessibility module for improving the interpretation of the scanned data and the resulting reports.
In particular, the feature request could include giving the option to do a pre-scan as opposed to a post-scan of the data.
The post scan is what is currently in use as that scans the renderred output.
A pre scan would happen before the content gets renderred and so line numbering would be correct according to the typed in the body field of a given node. The pre-scan would be less accurate but could cover individual fields.
Comment #20
jerry commentedFrankly, I'm not sure how useful the line number information is for this application. Given the way that pages are generated, the typical user will have no reference for these numbers. Since they're provided with accurate code context, I'd be in favor of simply removing the line reporting from node_accessibility to reduce confusion. I'll open a feature request there with that suggestion. I've no objection to closing the issue here. Thanks.
Comment #21
thekevinday commented