Closed (fixed)
Project:
RDF Extensions
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
9 Apr 2010 at 17:55 UTC
Updated:
3 Jan 2014 at 01:42 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mlncn commentedTagging as RDF.
Comment #2
adorsk commentedHere is a patch that adds a warning to the status page (/admin/reports/status) , and displays conflicting namespaces on the RDF settings page ( /admin/config/services/rdf/namespaces ).
Please note that that this is just a first draft. The display on the RDF settings page should probably be redesigned after namespace CRUD operations are added ( http://drupal.org/node/1117646 ).
Comment #3
scor commentedThanks adorsk for this patch! Please download the Dreditor tool to review your patch above, it will highlight several issues with regards to Drupal's coding standards (tabs should be 2 spaces, and there should be no trailing space).
we should move this style into a css file for rdfx
Also, there is some duplicated code in rdfx_requirements(), this could possibly be moved into the same function.
Comment #4
adorsk commentedRoger that scor, here's a revised patch.
Changes:
1. It should be now be compliant with Drupal's coding standards.
2. It uses the standard drupal error message class pair 'messages error' for displaying the warning message on the rdfx namespaces page
I did notice the similar code chunks in rdfx.module/rdfx_requirements and rdfx.admin.inc/rdfx_admin_namespaces . However, they're not doing exactly the same thing...one filters namespaces into two groups, the other just checks if there is a namespace conflict.
I prefer to leave this as-is for now, but let me know what you think.
Comment #5
scor commentedLooking much better Alex!
It's only an array if there are potential duplicates. The comment should say something like "$uri will be an array if there are duplicate namespaces for the prefix"
I would not include the unique URIs in this logic, and leave the unique URI table as it currently is in RDFx which calls the core rdf_get_namespace() API function. This patch should just add an extra table for the conflicting namespaces, that's it :)
I'm not sure you meant to change these lines... there are plenty of other hunks like this one which change the indentation as well.
That logic is more like what I was suggesting above. And you could have one function to get the conflicting namespaces, and call it here in rdfx_requirements() and when generating the table of conflicting namespaces.
Powered by Dreditor.
Comment #6
adorsk commented@scor
Your suggestions above sound good to me. Here's another try:
Changes:
1. Took out irrelevant spacing changes from the patch .
2. Added a function 'rdfx_get_conflicting_namespaces' to rdfx.module .
3. Used that function in rdfx.module/rdfx_requirements and rdfx.admin/namespaces .
Comment #7
scor commentedOk, last nitpicking and after that it's good to go!
I just tried this patch when I had no conflicting namespaces, and I found this message to be confusing. How about displaying this message only when it makes sense, that is to say only when there are conflicting namespaces?
you could spare the $conflicting_namespaces variable here and just call the function in the if statement...
Powered by Dreditor.
Comment #8
adorsk commentedNo worries, I appreciate the attention to detail.
Let's try this one.
Changes:
1. Valid namespaces label only is shown if there were namespaces with conflicts.
2. Took out unnecessary '$conflicting_namespaces = ' assignment in rdfx_requirements.
Comment #9
adorsk commentedSorry, forgot to change the issue status.
Comment #10
scor commentedWhile checking that patch, I found that the ending semi colon ":" looks odd inside a color box with nothing following it in the same color space. (I think it would look better without the :).
coding standard. no space inside the if parenthesis. remove newline too to keep code compact.
I would rather throw an error here, since the prefixes will not be output anywhere, developers should really be aware of that as early as possible.
probably could do with less new lines here.
Comment #11
adorsk commentedHere's an update that incorporates the suggestions made in #10.
Changes:
1. Removed the ':'s from the namespace table labels
2. Took out newlines, unnecessary comments.
Comment #12
scor commentedThanks Alex for your patience! I've committed your patch (see commit on your user profile). http://drupalcode.org/project/rdfx.git/commit/4ca99cf
Comment #13
adorsk commentedSweet! Thanks for your patience as well. I learned quite a bit about the process of making patches and coding standards. Hopefully I'll be able to put this experience into practice with future patches. I appreciate the high standards.