I have a site where the & (ampersand) sign is used frequently in orders. Unfortunately, when it is used the character code of & is output instead. Is there any way to fix this issue? I would like the character to display in exports, not the character code.

Thanks

Comments

deggertsen’s picture

I found a similar issue for views export that might be adapted to work here. Can somebody help me figure out how though? I'm not too good with PHP.

http://drupal.org/node/897830

deggertsen’s picture

I have set a bounty on this issue. Thanks for any help.

http://drupal.org/node/1595258

WorldFallz’s picture

I'm not able to create a patch at the moment, but there's a simple way you might be able to fix this:

change line 572 of uc_edi.module from:

if (file_save_data($contents, $filepath)) {

to

if (file_save_data(htmlspecialchars_decode($contents), $filepath)) {
jvizcarrondo’s picture

StatusFileSize
new1.58 KB

I just made a patch, this should work to restore only & and not other html entities removed by check_plain function.

Juan

fulgent’s picture

StatusFileSize
new4.75 KB
new538 bytes

Hello

The above patch is not valid for uc_edi 6.x-1.0 version.
It is only apply for new development version uc_edi 6.x-1.x-dev.

So I have attached two files respective for their proble:

uc_edi 6.x-1.0 : uc_edi.patch
uc_edi 6.x-1.x-dev : uc_edi-default.tpl.php_.txt (Please put this file into your theme folder /sites/all/themes/
/uc_edi-default.tpl.php) rename it to uc_edi-default.tpl.php

Thanks

deggertsen’s picture

Status: Active » Needs review

Thanks for the fast response everyone. Currently testing and will get back to you. Don't know who I should pay assuming these options work...

fulgent’s picture

Patch is also the right method But tpl is the more drupal standard way that is better then to patch because When you will to update module(Currently this is in the dev environment) in future, do not worries about patch and tpl is in your theme folder so it will not effect while you will update your uc_edi module.

deggertsen’s picture

I was able to fix the problem using a mixture of what was given above. I simply added the htmlspecialchars_decode function in my tpl.php file to all the variables that we were having issues with.

It would be nice to apply a more permanent solution to the module so that it is not necessary to do this, but for now this works. I will wait until a maintainer to see the issue and decide if it is something that should be fixed in the module before marking this as fixed.

Thanks for everyone's help.

deggertsen’s picture

Issue summary: View changes

haha, ampersand code output character. added code tags to fix this.