hey ufku,

this is a great module. i'm starting to use it a lot and decided instead of retyping my button mods in every time i install it, i should use your export import feature.

When i select the field checkboxes from installaiton, select Export and then Go, it creates a csv file but it appears that the columns are not populated with the right data.

What i mean is that all the fields and their subvalues seem to be exporting but when the csv file is created they don't get put under the right columns. As a result when I try to import the csv file in another bue installation, the keys dont' have the correct info. Basically, i think the problem has nothing to do with import just that the export isn't creating the columns the right way.

Not sure if this has anything to do with it but the when i create my custom buttons, I often don't assign shortcut keys. Just wondering if a subfield is blank if that would throw of the next subfield and all that follow it.

thanks for any help you can provide

CommentFileSizeAuthor
#5 Clipboard03_0.jpg52.53 KBufku
#3 bueditor_buttons.jpg739 bytesnewdru
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

newdru’s picture

OK,

i think i've figured out what's causing the problem

i will often enter custom buttons so they look like the following

%TEXT%

Notice that each string is on a separate line. That way my source code looks formatted the way i want it when i use your buttons to wrap text. And it works great.

Normally no linebreaks are inserted in your tags per

%TEXT%

But that's exactly how the tags get inserted in the source when you use those buttons.

The fact that i have linebreaks in my custom buttons is what's throwing off your export!

Is there anyway i can make my buttons behave the way i want and still have your export work correctly? I think it means somehow inserting a line break character. However when i try to use \ n per:

\n%TEXT%\n

those \n's get inserted into the text and i don't think they work or do what i want them to.

thanks

ufku’s picture

Status: Closed (fixed) » Active

I couldnt reproduce this.
Can you send me the csv file you got. And please state your browser and server(php,mysql etc) information.

newdru’s picture

FileSize
739 bytes

Well i forgot to put code tags in my original post.. before i send you stuff let me repost so you can see what i'm talking about

This is how i enter it (note each part is on a separate line) and it looks like the export misinterprets the line breaks

<p>
%TEXT%
</p>

Export WILL work if i put everything below all on one line

<p>%TEXT%</p>

If i try something like this to bridge the two it still doesn't seem to work:

<p>\n%TEXT%\n</p>

My settings are:

MySQL database 5.0.18
PHP 5.1.2
Unicode library PHP Mbstring Extension
Web server Apache/2.0.55 (Win32) PHP/5.1.2

I'll attach my speadsheet but i've changed the format from csv to jpg to i could upload it (make sure you change back to view it locally)

thanks

newdru’s picture

I forgot my browser is:

Firefox/1.5.0.11

thanks

ufku’s picture

FileSize
52.53 KB

I had successfully imported the file you send. All data went into corresponding fields with no error!

Import is done by fgetcsv function of PHP. In the manual there are two notes that might be related to your problem.

Note: Locale setting is taken into account by this function. If LANG is e.g. en_US.UTF-8, files in one-byte encoding are read wrong by this function.

Note: If you are having problems with PHP not recognizing the line endings when reading files either on or created by a Macintosh computer, you might want to enable the auto_detect_line_endings run-time configuration option.

Since it is about line breaks, the second note seems to be more connected with the case. You may try setting auto_detect_line_endings to true in php.ini or in settings.php

newdru’s picture

ufku,

can you show me a jpg of what the csv file looks like when you open it up in excel?

i ask because if i look at my csv file in excel BEFORE importing into bueditor, the data is not aligned under the columns the right way? I would think that only titles should be in the column 'titles'. And only content (button code) should be in the 'content' field. Etc for other columns. But it isn't that way when i look at it in excel. there is no rhyme or reason to the way the fields are aligned with respect to column titles. Aren't the fields supposed to be aligned with their corresponding titles in columns?

that leads me to believe it's not a problem with the import itself. am i missing something?

also. i'm not on a mac i'm on a windows box. and i didnt' find any language setting in my php.ini file. That utf parm you mentioned in the previous post - what key of a key=value pair would that belong to?

thanks

newdru’s picture

ufku,

i think i may have figured it out.

when i export the file as a .csv file, and then view the file in excel it looks crazy (even though it's saved as an excel .csv file format).

I would think that only titles should be in the column 'titles'. And only content (button code) should be in the 'content' field. Etc for other columns. But it isn't that way when i look at it in excel. there is no rhyme or reason to the way the fields are aligned with respect to column titles. Aren't the fields supposed to be aligned with their corresponding titles in columns when you look at the .csv file in excel?

So i thought, a csv file is really a text file with delmiters, so i opened the .csv file in vim (vi clone text editor if you don't know it) and then save the file as .txt. When i look at the buedito export file in vim, it makes more sense. I can see how a mutliline command spans multiple lines yet a new button title always starts on a new line.

When i import that csv file AS A TXT file into BUE it imports cleanly! When I import the csv as a native csv file it doesn't work???

Go figure. Either way i've got it working. I wish i knew why it doesn't import as a pure csv file. Any thoughts? Either way you can keep my experience in mind for someone who might have a future problem.

fwiw, I wasn't on a mac so i didn't think i needed to set that option. But this does appear to be a line ending type of issue.

also. assuming i did want to change my LANG var, where is that set? i don't see a LANG var anywhere in my php.ini. And if i was going to change it, what should it be?

Finally, what does BUE stand for? :-)

thanks

ufku’s picture

glad to hear that you solved it.
I see the same mixed-up view when i open the csv in MS Excel.
I'm on a Turkish Windows XP and no LANG set, no auto_detect_line_endings = true paremeter set, and having no problems importing. So, forget about those settings.
I'm not sure if it matters but, your system may be recognizing csv files as binary files. That could be why the problem solved when you convert it to txt.

BU - my initials. bayburt ufku :)

newdru’s picture

BU.. got it :-)..

yeah.. i'm not sure how i would change so my system reconginzes from binary to text..

either way i have it working..

thanks for you help bayburt

ufku’s picture

Status: Active » Closed (fixed)

Status: Active » Closed (fixed)