Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
For XML export, it would make sense to have an option allowing field content to be wrapped in CDATA.
Comment | File | Size | Author |
---|---|---|---|
#16 | views_data_export_d6-1465432-16.patch | 3.21 KB | junedkazi |
#13 | views_data_export-1465432-xml-cdata.patch | 6.46 KB | Steven Jones |
#11 | xml_field_cdata-1465432-10.patch | 3.12 KB | junedkazi |
#8 | xml_field_cdata-1465432-8.patch | 3.09 KB | junedkazi |
#5 | views_data_export-1465432-5.patch | 2.24 KB | klausi |
Comments
Comment #1
Dmitriy.trt CreditAttribution: Dmitriy.trt commentedPatch with implementation.
Comment #2
aoturoa CreditAttribution: aoturoa commentedthanks Dmitriy.trt for the patch, exactly what i needed.
I made small change so the CDATA is not applied on empty content.
Sorry for not using git patch, but the code below is pretty self explainable.
Comment #3
klausiPatch looks RTBC to me, integrated the suggestions from #2.
Comment #4
Dmitriy.trt CreditAttribution: Dmitriy.trt commentedZero will not be wrapped with CDATA. It's just a guess. Please set back to RTBC if I'm wrong.
Comment #5
klausiRight, we should better check for the empty string instead of using empty().
Comment #6
Dmitriy.trt CreditAttribution: Dmitriy.trt commentedInteger zero can't get here, right? Asking because
0 != ''
results inFALSE
and integer zero still won't be wrapped. Sorry I don't have this module installed at the moment and can't dig into it with debugger or properly analyze the code.Comment #7
Leo Pitt CreditAttribution: Leo Pitt commentedHi, it would be great if it were possible to apply CDATA to individual fields rather than all fields in the view.
Comment #8
junedkazi CreditAttribution: junedkazi commentedOk so I need it to be based on per field. So I am attaching a patch for review.Also a cleanup as there were some + signs in the comments.
Comment #9
junedkazi CreditAttribution: junedkazi commentedSetting it to needs review.
Comment #11
junedkazi CreditAttribution: junedkazi commentedComment #12
Steven Jones CreditAttribution: Steven Jones commentedThis patch looks okay, but we need some tests to make sure this functionality works. There should be test for not-escaping certain fields, which would be a good basis for a test.
Comment #13
Steven Jones CreditAttribution: Steven Jones commentedHere's a patch for the testbot.
Comment #14
Steven Jones CreditAttribution: Steven Jones commentedThanks everyone, committed to 7.x-3.x.
Comment #15
Steven Jones CreditAttribution: Steven Jones commentedNow needs backporting.
Comment #16
junedkazi CreditAttribution: junedkazi commentedComment #16.0
junedkazi CreditAttribution: junedkazi commentedremoved comments that were potentially unrelated to the feature request/issue
Comment #18
Steven Jones CreditAttribution: Steven Jones commented@junedkazi thanks for the patch!