Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
datetime.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
19 Nov 2013 at 21:30 UTC
Updated:
29 Jul 2014 at 23:08 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
djevans commentedThe simplest thing seems to be to remove the hardcoded reference to dc:date. Adding RDF mappings to datetime fields then adds the @property attribute to the wrapper
<div>of each individual<time>element.This also shouldn't affect any of the property mappings that already exist in core.
Comment #2
djevans commentedComment #3
scor commentedI'd rather add the @property inside the time element since the new field formatters in D8 allow that. See how the taxonomy field formatter does it.
Comment #4
djevans commentedOK, @property now belongs to the inner
<time>element, using a similar approach to the Taxonomy module's LinkFormatter. The comments in template_preprocess_field() also helped.Comment #5
djevans commentedComment #6
djevans commentedComment #9
djevans commentedComment #10
scor commentedComment #11
chrisfromredfinpatch re-rolled... seems like the filename just changed.
Is there other work to do on this in terms of the actual solution, or is the formatter acceptable as-is?
Comment #12
scor commentedWe will need test for this one as well, much like the other field formatters.
Comment #13
chrisfromredfinThis patch is the above patch, plus a new test for the datetime_default formatter. TBD is whether or not we need to test the datetime_plain formatter. As of right now it doesn't support RDFa at all, so we're not sure if either (a) the formatter should go away, (b) the formatter should stay as is, and not support RDFa, or (c) we should include support for RDFa in the plain formatter.
Note that it also includes a change to the signature for FieldRdfaTestBase::assertFormatterRdfa() by adding a fifth parameter for $datatype. Probably a better approach here is to pass in $expected_value as an array, rather than take three values in the function signature, but I will leave that to another issue. For now, this is preferred because it won't break other tests.
Comment #14
vijaycs8513: rdf-datetime_rdfa_support-2139551-13.patch queued for re-testing.
Comment #15
vijaycs85missing new param in docblock. Adding in this patch.
Comment #16
scor commentedThe dc:date came from contrib when the date module was first introduced in core. It should be removed since we now use the attributes that come from config (like this patch already does). The following line also need to be removed:
I've mulled over this for the last couple of weeks and I'm convinced we shouldn't support/worry about this field formatter, I'm not even sure why someone would want to use this field formatter and have RDFa at the same time. I'm not even sure what the purpose of this field formatter is on its own (but that's beyond this issue). Moreover, if someone really want to have RDFa with a similar output as the plain formatter, they could register a custom date format and choose it in the settings of the default date formatter, and get RDFa for free via the time HTML5 element.
Comment #17
ashepherd commentedAddressed comment #16. Run the datetime test and is passing locally.
Comment #18
scor commentedLooks good, thanks Adam, djevans, cwells, vijaycs85 for your work on this patch!
Comment #19
catchCommitted/pushed to 8.x, thanks!