Re: Flexible Return Authorization (RMA) for ZC v1.5.x [Support Thread]
Quote:
Originally Posted by
DigitalShadow
if the reason text includes a
it breaks the submission
Is there a fix?
No bug or error. This is because this is how PHP works. The define files are probably like this:
PHP Code:
define('SOME_CONSTANT_DEFINED', 'The text that is going to be used to act as the definition.');
When you put in a ' in that second part (after the comma), you're breaking the define and PHP does not know how to handle it. The easiest way to fix this, is to remember that whenever you're working with single quotes or double quotes, that you should use a backslash (\) immediately before. To that end, if you plan on using the backslash itself, you need to use a double backslash instead (\\). The single backslash tells php that the character following the slash is a "special" character. This include "\n" which causes a newline break in plain text (or preformatted <PRE> text) or "\t" which inserts a tab in the same sense. \' indicates to PHP that it should output a single quote and \" should output a double quote.
Leaving that off, you get something like this.
PHP Code:
define('SOME_CONSTANT_DEFINED', 'You can't just insert a single quote.');
Notice how part of the text that is supposed to be defining the constant is red and the other part is blue. The part that is red (without the quote) will be defined into the constant, but the part in blue will generate an error since this is not correct syntax. Since the ' are being used to delimit the definition, PHP is expecting a ' to delimit the text. Without escaping it, PHP will interpret the first ' as the end of the string to define while PHP tosses its hand up figuratively since it doesn't know how to handle the blue.
NOTE: If the string is being delimited with a double quote, you can safely use the single quote inside a set of double quotes safely. As well as vice versa. Example:
PHP Code:
define('SAMPLE_CONSTANT_2', "This string is being delimited with double quotes, so I can use ' without using a backslash safely.");
PHP Code:
define('SAMPLE_CONSTANT_3', 'This string is being delimited with single quotes, so I can use " without using a backslash safely.');
Re: Flexible Return Authorization (RMA) for ZC v1.5.x [Support Thread]
When entering the reason text add a backslash to words with Apostrophe or Single Quotes
example:
WRONG
I didn't want it.
RIGHT
I didn\'t want it.
Will still show in the reasons drop-down select as I didn't want it.
Quote:
Originally Posted by
DigitalShadow
if the reason text includes a
it breaks the submission
Is there a fix?
Re: Flexible Return Authorization (RMA) for ZC v1.5.x [Support Thread]
No, the error is in the box the customer writes in, i'm aware of the php issue, which is why I couldn't believe this add-on would have a bug like this in it.
If the customer uses an apostrophe it breaks the rma submission.
Re: Flexible Return Authorization (RMA) for ZC v1.5.x [Support Thread]
just to clarify my above comment, i assume I have created the bug, somehow by changing something, but I wanted someone else to confirm if they could replicate the issue.
if you submit an rma request and in the text box, enter a sentence with an apostrophe does the rma submit correctly?
Re: Flexible Return Authorization (RMA) Support Thread
I don't know if this has been reported before, I checked the thread but couldn't find any mention of it. I found an error on the code on tpl_returns_default.php at around line 264
This is the code that appears on the file
PHP Code:
<?php
switch (RETURN_ACTION_LIST) {
case 0:
echo '<li><h4><?php echo ENTRY_ACTION_INFO; ?></h4><label class="inputLabel">' . ENTRY_ACTION . RETURN_OPTIONAL_IMAGE . '</label>' . zen_draw_pull_down_menu('action', $entry_action_array) . '</li>';
break;
case 1:
echo '<li><h4><?php echo ENTRY_ACTION_INFO; ?></h4><label class="inputLabel">' . ENTRY_ACTION . RETURN_REQUIRED_IMAGE . '</label>' . zen_draw_pull_down_menu('action', $entry_action_array) . '</li>';
break;
}
?>
<?php
}
?>
It should be changed to this for the tag H4 for display
PHP Code:
<?php
switch (RETURN_ACTION_LIST) {
case 0:
echo '<li><h4>' . ENTRY_ACTION_INFO . '</h4><label class="inputLabel">' . ENTRY_ACTION . RETURN_OPTIONAL_IMAGE . '</label>' . zen_draw_pull_down_menu('action', $entry_action_array) . '</li>';
break;
case 1:
echo '<li><h4>' . ENTRY_ACTION_INFO . '</h4><label class="inputLabel">' . ENTRY_ACTION . RETURN_REQUIRED_IMAGE . '</label>' . zen_draw_pull_down_menu('action', $entry_action_array) . '</li>';
break;
}
?>
<?php
}
?>
Re: Flexible Return Authorization (RMA) Support Thread
Quote:
WARNING: An Error occurred, please refresh the page and try again.
I am getting the above error when I reload the admin after uploading the modules files. I tried the fix from a page or so back, it still does the same thing after using uninstall sql. I also checked the phpmyadmin, I can't find any old traces of this module (I have been using the module since it first came out). Just the last version seemed to cause this issue.
Is there just a plain sql file version available at all, instead of the conig and autoloader for install please?
Thanks in advance
Re: Flexible Return Authorization (RMA) Support Thread
I haven't revisited this in a while and the original sql file no longer exists on my end.
try post #95, that should fix the issue.
Quote:
Originally Posted by
HeathenMagic
I am getting the above error when I reload the admin after uploading the modules files. I tried the fix from a page or so back, it still does the same thing after using uninstall sql. I also checked the phpmyadmin, I can't find any old traces of this module (I have been using the module since it first came out). Just the last version seemed to cause this issue.
Is there just a plain sql file version available at all, instead of the conig and autoloader for install please?
Thanks in advance
Re: Flexible Return Authorization (RMA) Support Thread
Hi there
Thanks so much for your reply! I did try that, and uploaded the file again. But what I might do is see if any of the other tables have been appended with an extra field in the same way. I will go through it thoroughly, it must simply be that there is a small fragment left somewhere blocking the upgrade script.
Thanks again!
James :-)
Re: Flexible Return Authorization (RMA) for ZC v1.5.x [Support Thread]
I would rather the number generated for the RMA was random instead of generated by ordernumber and date and customer number, the number is tooooooooo long.
What file generates the rma number?
Re: Flexible Return Authorization (RMA) Support Thread
Any updates on this plugin working with ZC 1.5.3? I have installed it following the instructions and am also getting the "WARNING: An error occurred, please refresh the page and try again." issue.
Quote:
Originally Posted by
HeathenMagic
I am getting the above error when I reload the admin after uploading the modules files. I tried the fix from a page or so back, it still does the same thing after using uninstall sql. I also checked the phpmyadmin, I can't find any old traces of this module (I have been using the module since it first came out). Just the last version seemed to cause this issue.
Is there just a plain sql file version available at all, instead of the conig and autoloader for install please?
Thanks in advance