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.
If there is an image in the 'body' field, then none of the regular text is outputted - only the image path is in the JSON string. If I remove the image from the field, then all the text is properly outputted.
Comment | File | Size | Author |
---|---|---|---|
#7 | views_datasource-remove_img_matching_code-1692230-d6.patch | 5.01 KB | whastings |
#3 | views_datasource-remove_img_matching_code-1692230-6253794.patch | 4.67 KB | rrrob |
Comments
Comment #1
rrrob CreditAttribution: rrrob commentedThe offending code block is in views_json.module lines 174-189:
What is the purpose of this?
Comment #2
rrrob CreditAttribution: rrrob commentedIs it safe to assume that the purpose of this code block is to strip everything but the url from image fields? I can see where this would be useful, but the Image URL Formatter module already handles this.
This code needs to be removed from all 4 modules of this project.
Comment #3
rrrob CreditAttribution: rrrob commentedPatch attached.
Comment #4
Alexander Allen CreditAttribution: Alexander Allen commentedMany thanks for the patch deckerdev. I do agree with you that those lines of code are more crusty than a New York-style, thin crust, burnt Domino's pizza. I also find that "regexing" all rendered fields for an image in order to intercept it and modify the output is ugly. Be aware however that I've created issue #1699368: #RVDA: Rewrite Views Datasource's Architecture, and that this fix will be incorporated into that. As of now #1699368 is a priority (it does change all plugins, FYI), and I will make sure to look into this issue after #1699368 is complete.
Comment #5
Alexander Allen CreditAttribution: Alexander Allen commentedTagging due to dependency in #1699368: #RVDA: Rewrite Views Datasource's Architecture.
Comment #6
Alexander Allen CreditAttribution: Alexander Allen commentedMarking as duplicate to reduce size of active queue.
Again, will be fixed for #1699368, but it has been added to issue #1623606: Views Datasource 2.x branch for QA testing.
Thank you.
Comment #7
whastings CreditAttribution: whastings commentedI had to make a version of the patch in #3 for a Drupal 6 site, so here it is in case anyone else needs it. I made it against 6.x-1.x-dev