Repeatable: Always
Steps to repeat:
1. Import data from an excel-sheet with a sum-field
2. Compare resulting entry in drupal-field with the sum. It will not contain the result. Instead it will show the last value of the addition.

Expected Results:
Importing the sum instead of only one value of the addition.

Actual Results:
Imported values from sum fields do only contain one part of the sum - instead of the result.

Sum fields have been importable in version 7.x-0.0 of the module. Therefore I still have to work with this old version, as it is the only working version of the module so far.

The modified behaviour does persist from 7.x-1.0 through all versions till 7.x-1.2 (including the dev version)

PHP 5.4
Drupal 7.35

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sdrycroft’s picture

I suspect this is related to the introduction of the chunkReadFilter class. The chunk reader was introduced as a way of drastically reducing the memory consumption of the parser, and also to improve the time it takes to read rows nearer to the bottom of the file (each loop of the parser opens the Excel file, and reads in each line from the top).

To fix your issue, I will need to make the use of the chunkReadFilter class optional.

Mediengenosse’s picture

Dear sdrycroft,
this would be great, if you could implement this option. Please let me know, as soon as it finds it way into a dev-version of the module. I would right away test it.
We rely heavily on it on our site ecotopten.de. Many thanks!

  • sdrycroft committed ef11d88 on 7.x-1.x
    Issue #2475095: Make the use of the chunk reader optional, although...
sdrycroft’s picture

Assigned: Unassigned » sdrycroft
Status: Active » Needs review
FileSize
81.36 KB

I've added a possible fix for this, which will be included in the latest development release. An additional option has been added to the parser options (note, it is only displayed when configuring the feed, and not when submitting a job/uploading a file), which defaults to using the chunked reader. You will need to edit an importer and uncheck the box marked "Use chunk reader" (see screenshot).

Check box that needs unchecking

Please can you test this, and let me know how you get on.

Mediengenosse’s picture

I tested the newest dev-release and unfortunately it still does not import the sum - but the last value of the equation instead.
There is no difference: In case I do uncheck the box "Use the chunk reader" the output is still the same.

I tested it several times and cleared caches before proceeding - but did always get the same result.

sdrycroft’s picture

@Mediengenosse please could you provide a minimal file that is not importing for you (preferably two columns) and I will try and recreate this issue locally.

Mediengenosse’s picture

@sdrycroft

Enclosed you please find a sample xls-sheet reduced to 5 columns.
I tested it before sending it to you and it does show the error.

The sum-value of row E ("12") is 454 or 341, but when imported does show 84 or 81 instead (the values of the last part of the equation, which is row C or "11").

I very much appreciate the work you are doing! Many thanks!

sdrycroft’s picture

I think this may be related to equations across worksheets, which may not be something I can fix. I'll investigate further and see if there is a way around the problem.

Mediengenosse’s picture

The same equations across worksheets are flawlessly imported with the 7.x-0.0 version of the module.
So it might be fixable? That would be great!

sdrycroft’s picture

I've just made time to revisit this, and am still having issues recreating this problem. Can you provide me with a much simpler example (with full instructions on how I can recreate the problem) that will help me to recreate the issue locally. As an example, I've used the attached Excel file which imported all 200 rows perfectly.

Mediengenosse’s picture

I tested your file and indeed it does import flawlessly.
So I tried to more sharply localise the error with the help of your file.
I found out, that the problem occurs, when a calculated value is part of a calculation itself which does draw data from another sheet.
I reconstructed the problem within your file. Now the field body2 does reproduce the error.
Might you be able to give this modified file one more try? I think, we now have located the problem very thoroughly.

sdrycroft’s picture

This one also worked for me - the final two nodes, "Title 200" and "Title 199", both have correct values for their body fields 99093 and 34000 respectively. Are those body field values correct (they appear to be correct to me, but it's possible OpenOffice is not displaying the values you were expecting in the Body2 column)?

Mediengenosse’s picture

34000 and 99093 are the correct values for field "Body2".
When I am importing, field "Body2" does show different values: 33830 and 98600 - the same as field "Body" does.
In my case field "Body2" ist not imported correctly, as it does not draw the second value of the calculation.

sdrycroft’s picture

What version of PHPExcel are you using (I'm testing with 1.7.8), and what server configuration do you have?

Mediengenosse’s picture

Im am working with PHPEXcel 1.8.0 under PHP 5.4.39. Should I try a different setup?

sdrycroft’s picture

Hmmm, it looks like you'll need to use PHPExcel 1.7.8. I'm looking into why this is the case.

sdrycroft’s picture

Status: Needs review » Fixed

The issue appears to have been fixed in PHPExcel 1.8.1 (https://github.com/PHPOffice/PHPExcel/archive/1.8.1.zip). Please upgrade to that and re-open this issue if you continue to experience this bug.

Mediengenosse’s picture

This solution fixed the bug for me as well. So many thanks!!

sdrycroft’s picture

Thanks @Mediengenosse, great to hear this fixed your issue too. Slightly annoying that this was a bug with an external library, and not actually with the feeds_xls module, but glad that we got it tracked down.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.