Closed (fixed)
Project:
Feeds XPath Parser
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
28 Nov 2013 at 22:15 UTC
Updated:
13 Jul 2015 at 01:41 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
oddible commentedComment #2
raul_drupal_dev commenteddid you configure the import properly? I mean, in node processor, did you assign the "bundle" to any content type? The code you're showing it's look ok, The problem should be in the config side.
Comment #3
oddible commentedThanks, yep, I selected the content type that I wanted to import in bundle. The confounding factor here is that there is zero feedback whatesoever. I'm not getting a single message back indicating where the problem may be. Is there some sort of flag I can turn on to get some progress messages? Did it download the file? Was there an issue parsing the file? Did it have trouble setting up to import the correct bundle? I'm not getting a single clue to where to look for issues.
Comment #4
j-conk commentedoddible, I am wondering if your context is right.
Context: //titles
title: title
id: title/id
Comment #5
oddible commentedThanks j-conk, tried several different xpath queries, all work fine in my test app. Tried what you listed above and got no imported items.
Again, I'm desperate for some feedback from the app - it doesn't show the status of any part of its process, zero info where the issue may be occurring.
Comment #6
theoracleprodigy commentedI am running into the same issue ( not to hijack the thread just seems like the same issue ) . I can even find the content in the database which is odd. I have run through the node, the node revisions everything looks like its there. The content however does not show up at all on the website. This was first built on a different site with the same content type and same import file. It worked in test but now that we need it for production it is not working what so ever. Here is a sample of the xml:
This is attached to a document type and I have these setting on the xpath parser settings:
context
article
title
title
The only difference I can think of is that this is a domains website but I don't see why that would cause an issue.
Comment #7
oddible commentedDespite any individual issues in getting this working, the issue here - that remains open - is a complete lack of error reporting or progress messaging so users have zero feedback as to how far things are getting or where any issue may or may not be occurring.
Comment #8
ianthomas_ukI think this is a regression caused by #1397434: Implement batch parsing.
My XML file is structured as follows:
I want to create/update a node for each programme and with 7.x-1.0-beta3 this worked with the context configured as
programmes/programme.In beta4, FeedsXPathParserBase::parse(), there are now two calls to namespacedQuery. The first returns 0 unless I set the context to
data/programmes/programmeand the second returns 0 results unless the context isprogrammes/programme(I had to manipulate the context myself between the two calls for testing because otherwise the second call had[position() > 0 and position() <= 0]).I've never really used XPath before, so I'm not sure which is correct.
As a general comment on the code, I was a bit confused by the $this->doc variable, as it's passed as a parameter to the first call by omitted from the second call. It also seems to duplicate XPath's own $this->document variable. Maybe there's a situation where $context is useful, but it would seem better practise to create a new XPath object if you want to operate on a different DOMDocument. I also don't understand why FeedsXPathParserDOMXPath::executeQuery() switches between calling evaluate() and query() depending on if $context is set.
Comment #9
ianthomas_ukThis seems to be working for me if I change
to
which makes sense, as looking at the documentation on php.net the difference between query and evaluate is that query doesn't return anything, but evaluate does. What doesn't make sense is how it was working in 7.x-1.0-beta3.
I'm not going to upload this as a patch until someone can explain *why* this is the correct fix, as I'm worried it will have some side effects that I haven't realised.
Comment #10
ianthomas_ukI'm gaining confidence in my patch, so here it is. First I remove the context from the count query so the two queries are consistent, then I switch the normal query to use evaluate() so it actually returns results.
Comment #11
twistor commentedWe can't change those calls. evaluate() and query() do very specific things. One returns a literal result and one always returns a node list.
In #8, the contexts
programmes/programmeanddata/programmes/programmeare both incorrect.You would need either
/data/programmes/programmeor//programmes/programmeComment #12
twistor commentedComment #13
twistor commentedwoops.
Comment #14
twistor commentedThe query string truncation is still the issue. I have a fix for that somewhere around here.
Comment #16
twistor commentedNevermind. Just added a test to confirm that this works.