Support is online

Small bug in Tab delimited CSV? #7549

Open peterva opened this topic Tuesday, 18 August 2015 · 19 replies
Author

Hi Roland, I just upgraded to CSVI 6.1.0 + VM plugins.

I noticed that on Tab delimited CSV export, the CSV file suddenly has a starting tab. This means that my column headers and fields are out of sync. See the attached images for clarification.

Can you provide a fix for this? Thanks!

  • view2.jpg
  • view1.jpg
Support

Hello Peter,

Can you export your template and post it here, so I can run it on my test site? A regular export does not show this starting Tab here.

Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory

Author

I tried but get the following error:

Error
Unknown column 'section' in 'field list' SQL=SELECT name,action,ordering,plugin,plugin_params,section FROM rhpg_csvi_rules AS r LEFT JOIN rhpg_csvi_templatefields_rules AS t ON t.csvi_rule_id = r.csvi_rule_id WHERE t.csvi_templatefield_id = 123

I also cannot import any templates, e.g. the example templates, I get 'processed: 0'
Now I don't use any example templates, but maybe this is an indication that there is something wrong with my install or config?

Support

The section column has been removed in the 6.1.0 release and it appears the SQL changes have not been executed. If you go to the About page, click on the Fix database and see if that fixes anything. If not, you can also manually delete the section column from the rhpg_csvi_rules table.

Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory

Author

The section column has been removed in the 6.1.0 release and it appears the SQL changes have not been executed. If you go to the About page, click on the Fix database and see if that fixes anything. If not, you can also manually delete the section column from the rhpg_csvi_rules table.

Hmm, I did all that and still get the same error on template export:
Error
Unknown column 'section' in 'field list' SQL=SELECT name,action,ordering,plugin,plugin_params,section FROM rhpg_csvi_rules AS r LEFT JOIN rhpg_csvi_templatefields_rules AS t ON t.csvi_rule_id = r.csvi_rule_id WHERE t.csvi_templatefield_id = 84

Also, there is no column 'section' in the rhpg_csvi_rules table (see image).

Help appreciated.

  • rulestable.jpg
Support

Hello,

While checking your issue I realized I was testing templates with no rules linked to their fields, that is why I didn't see the same error as you. Once I did, it was a quick fix. Find attached a patch file you can load and the template export and import should work fine again.

Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory

Author

Hi Roland, thanks! But ... there still seems to be a small bug. I get this error:

Error
Table 'saint_dev.rhpg_csvi_templates_rules' doesn't exist SQL=SELECT name,action,ordering,plugin,plugin_params FROM rhpg_csvi_rules AS r LEFT JOIN rhpg_csvi_templates_rules AS t ON t.csvi_rule_id = r.csvi_rule_id WHERE t.csvi_template_id = 5

It looks like it's putting the db name in front of the first entry.

Support

Hello,

Apologies, the template rules are completely gone in 6.1, so it shouldn't do anything with it. Attached is an updated patch file that has all this code removed. A little odd I didn't get the error but it should now really be fixed.

Let me know how it goes.

Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory

Author

thanks!

Author

Ok Roland, the template export is fixed.

Now back to the original problem: I get a starting tab with my tab delimited csv export. This means my column headers and column fields are out of sync.

Can you see anything strange in these files?

Support

Hello Peter,

Ok with your template I also don't get a leading tab. I am wondering if you have an outdated file. So I attached a patch file of the file I have. Please load this patch and see if your export is OK.

Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory

Author

Hi Roland, I still get the leading tab, also with your patch ...

To eliminate any old files I deleted csvi, cleaned the tables, installed version 6.1.1 but stil the same results.

You're welcome to have a look at my config if you like.

Support

Hello Peter,

Send me the login details of the site and FTP and I will take a look.

Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory

Author

Hi Roland, thanks for having a look, too bad that you couldn't find the culprit :(

I have tried reverting to version 6.0.1 (when I didn't get the leading tab). But this made no difference, now the tab is here too.

So I'm stuck here ... no idea how to proceed.

Author

So ... I found the cause of the leading tab.

It appears it has nothing to do with CSVI, but with a custom fields plugin I use for Virtuemart which converts my size and color dropdowns into buttons (see images).

This plugin was custom made by an external developer. I will ask him to correct the problem.

In the meantime, I can export normally when the plugin is disabled (no use for cron jobs then).

Thanks for helping to narrow the problem down.

  • with_plugin.jpg
  • without_plugin.jpg
Support

Hello Peter,

Good to hear that the issue is solved and thanks for reporting back.

Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory

Author

Just one quick question: my developer was wondering how his plugin could influence the CSVI export, since it does nothing in the database and only consists of files. So what's the routing, any thoughts on this?

Support

Plugins are loaded by Joomla, so I think once the buffer is open, it catches the tab character. It should just be a matter of removing the culprit tab character from the plugin file.

Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory

Author

Hi Roland, still struggling with the leading tab issue. The plugin was checked but nothing was found.

But ... we just discovered that the leading tab is only there when the source setting is 'download'. When the setting is changed to 'email file', I get a perfect csv in my mail, without the leading tab.

Does this give you any new clues as to what's happening?

Support

Hello Peter,

The plugin was checked but nothing was found.

You do know that when the plugin is disabled it doesn't add the tab. It may be worth checking if you remove the code from the plugin file and add it part by part to see which part adds the tab.

But ... we just discovered that the leading tab is only there when the source setting is 'download'.

That is because of the way the server/php works. Once Joomla starts the output session, anything send to it is captured. What I saw when I was checking, once the headers are being send to the browser, the tab was already there.

When the setting is changed to 'email file', I get a perfect csv in my mail, without the leading tab.

That is another type of stream. That is why you won't see it there.

Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory

Log in to reply to this topic.