Forums

Reading Data Not Working Correctly After Update

cre8tivemedia 09 Apr, 2019
I set up my form to grab a variable from a read data based on the selection in a radio group. Partial code is as follows -
else {
return "
<br>
<font size ='3'>
<b>Step 1</b> -- Go to <b><a href='{var:php_portal}' target='_blank'>{var:read_data17.load_fields.metakey}</b></a>, then make sure you are logged into your account and that you have disabled any AdBlocking software that you may have enabled<br><br>

<b>Step 2</b> -- Click on the 'Shop Now' button. This 'portal' link will bring you directly to <b>{var:read_data17.load_fields.created_by_alias}</b> and allow you to earn up to <b>{var:read_data17.load_fields.introtext}%</b> just by clicking through<br><br>

<b>Step 3</b> -- Shop as you normally would at <b>{var:read_data17.load_fields.created_by_alias}</b> and save items to your cart but <font color='red'><u>Do Not</u></font> checkout unless you do not want additional savings<br><br>

<b>Step 4</b> -- Write down (or remember) the total in your cart at <b>{var:read_data17.load_fields.created_by_alias}</b> including tax and shipping<br><br>

<b>Step 5</b> -- Go to <a href='{var:php_cards}' target='_blank'><b>{var:read_data26.load_fields2.metakey}</b></a> to purchase discounted gift card(s) at up to <b>{var:read_data26.load_fields2.introtext}% off</b>.<br>

<font size ='2'>-- Most stores allow you to use up to 4 different gift cards when checking out (check the website if you plan on using more)<br><br>
</font>

<b>Step 6</b> -- Return to <b>{var:read_data17.load_fields.created_by_alias}</b> and checkout as you normally would but remember to use your gift cards as your payment method<br><br>

Congratulations! You saved as much as <b>{var:php35_add_introtext}%</b> by spending a couple of extra minutes shopping!
</font>";
}
It appears to get the correct info in the first instance that the variable is called -
{var:read_data17.load_fields.created_by_alias}
but the remaining instances are shown as text in the front end



Do I need to do this a different way after the update or is this a bug?


Front End of form is here -

https://dealgetr.com/calculator

Joomla 3.9.5
CFv6.0.28
Max_admin 10 Apr, 2019
The debugger shows the variable as set ?

Where do you have this code ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
cre8tivemedia 10 Apr, 2019
I have it in a php called "php_steps" -
here is the full code-
$steps = json_decode($this->get("read_data26.load_fields2.introtext"), true);
$steps2 = json_decode($this->get("read_data17.load_fields.introtext"), true);

if($steps === NULL AND $steps2 === NULL) {
return "
<br>
<font size ='3'>
Please Make A Selection From The Choices Above </font>";
}
elseif ($steps === NULL AND $steps2 >= 0) {
return "
<br>
<font size ='3'>
<b>Step 1</b> -- Choose a Gift Card From the Choices Above or Continue to Step 2<br><br>

<b>Step 2</b> -- Go to <a href='{var:php_portal}' target='_blank'><b>{var:read_data17.load_fields.metakey}</b></a>, then make sure you are logged into your account and that you have disabled any AdBlocking software that you may have enabled<br><br>

<b>Step 3</b> -- Click on the 'Shop Now' button. This 'portal' link will bring you directly to {var:read_data17.load_fields.created_by_alias} and allow you to earn up to <b>{var:read_data17.load_fields.introtext}%</b> just by clicking through<br><br>

<b>Step 4</b> -- Shop as you normally would at <b>{var:read_data26.load_fields2.created_by_alias}</b> and checkout <br><br>

Congratulations! You saved as much as <b>{var:read_data17.load_fields.introtext}%</b> by spending a couple of extra minutes shopping!

</font>";
}
elseif ($steps2 === NULL AND $steps >= 0) {
return "
<br>
<font size ='3'>
<b>Step 1</b> -- Choose a Portal From the Choices Above or Continue to Step 2<br><br>

<b>Step 2</b> -- Shop as you normally would at <b>{var:read_data26.load_fields2.created_by_alias}</b> and save items to your cart but <font color='red'><u>Do Not</u></font> checkout unless you don't want additional savings<br><br>

<b>Step 3</b> -- Write down (or remember) the total in your cart at <b>{var:read_data26.load_fields2.created_by_alias}</b> including tax and shipping<br><br>

<b>Step 4</b> -- Go to <a href='{var:php_cards}' target='_blank'><b>{var:read_data26.load_fields2.metakey}</b></a> to purchase discounted gift card(s) at up to <b>{var:read_data26.load_fields2.introtext}% off</b>.<br>
<font size ='2'>-- Most stores allow you to use up to 4 different gift cards when checking out (check the website if you plan on using more) <br><br>
</font>

<b>Step 5</b> -- Return to <b>{var:read_data26.load_fields2.created_by_alias}</b> and checkout as you normally would but remember to use your gift cards as your payment method
<br><br>

Congratulations! You saved as much as <b>{var:read_data26.load_fields2.introtext}%</b> by spending a couple of extra minutes shopping!

</font>";
}
else {
return "
<br>
<font size ='3'>
<b>Step 1</b> -- Go to <b><a href='{var:php_portal}' target='_blank'>{var:read_data17.load_fields.metakey}</b></a>, then make sure you are logged into your account and that you have disabled any AdBlocking software that you may have enabled<br><br>

<b>Step 2</b> -- Click on the 'Shop Now' button. This 'portal' link will bring you directly to <b>{var:read_data17.load_fields.created_by_alias}</b> and allow you to earn up to <b>{var:read_data17.load_fields.introtext}%</b> just by clicking through<br><br>

<b>Step 3</b> -- Shop as you normally would at <b>{var:read_data17.load_fields.created_by_alias}</b> and save items to your cart but <font color='red'><u>Do Not</u></font> checkout unless you do not want additional savings<br><br>

<b>Step 4</b> -- Write down (or remember) the total in your cart at <b>{var:read_data17.load_fields.created_by_alias}</b> including tax and shipping<br><br>

<b>Step 5</b> -- Go to <a href='{var:php_cards}' target='_blank'><b>{var:read_data26.load_fields2.metakey}</b></a> to purchase discounted gift card(s) at up to <b>{var:read_data26.load_fields2.introtext}% off</b>.<br>

<font size ='2'>-- Most stores allow you to use up to 4 different gift cards when checking out (check the website if you plan on using more)<br><br>
</font>

<b>Step 6</b> -- Return to <b>{var:read_data17.load_fields.created_by_alias}</b> and checkout as you normally would but remember to use your gift cards as your payment method<br><br>

Congratulations! You saved as much as <b>{var:php35_add_introtext}%</b> by spending a couple of extra minutes shopping!
</font>";
}


here is the debugger -
Array
(
    [read_data26] => Array
        (
            [log] => Array
                (
                    [0] => SELECT `load_fields2`.`id` AS `load_fields2.id`, `load_fields2`.`introtext` AS `load_fields2.introtext`, `load_fields2`.`title` AS `load_fields2.title`, `load_fields2`.`created_by_alias` AS `load_fields2.created_by_alias`, `load_fields2`.`alias` AS `load_fields2.alias`, `load_fields2`.`catid` AS `load_fields2.catid`, `load_fields2`.`images` AS `load_fields2.images`, `load_fields2`.`metakey` AS `load_fields2.metakey` FROM `ox56k_content` AS `load_fields2` WHERE `load_fields2`.`id` = '20739' LIMIT 2000;
                )

            [var] => Array
                (
                    [load_fields2] => Array
                        (
                            [id] => 20739
                            [introtext] => 3.0
                            [title] => Up to 3.0% Off  Sears Gift Cards  - (Raise)
                            [created_by_alias] => Sears
                            [alias] => raise-sears
                            [catid] => 12
                            [images] => {"image_intro":"","float_intro":"","image_intro_alt":"","image_intro_caption":"https:\/\/dnrzlv4wd9rbi.cloudfront.net\/assets\/product-sources\/105\/medium\/sears-gift-card.png?1441391953","image_fulltext":"","float_fulltext":"","image_fulltext_alt":"","image_fulltext_caption":"https:\/\/click.linksynergy.com\/deeplink?id=JaPpwFNgpXE&mid=38426&murl=https%3A%2F%2Fwww.raise.com%2Fbuy-sears-gift-cards"}
                            [metakey] => Raise
                        )

                )

        )

    [read_data17] => Array
        (
            [log] => Array
                (
                    [0] => SELECT `load_fields`.`id` AS `load_fields.id`, `load_fields`.`introtext` AS `load_fields.introtext`, `load_fields`.`title` AS `load_fields.title`, `load_fields`.`created_by_alias` AS `load_fields.created_by_alias`, `load_fields`.`alias` AS `load_fields.alias`, `load_fields`.`catid` AS `load_fields.catid`, `load_fields`.`images` AS `load_fields.images`, `load_fields`.`metakey` AS `load_fields.metakey` FROM `ox56k_content` AS `load_fields` WHERE `load_fields`.`id` = '20065' LIMIT 2000;
                )

            [var] => Array
                (
                    [load_fields] => Array
                        (
                            [id] => 20065
                            [introtext] => 1.0
                            [title] => Sears - Get Up To 1.0% Cash Back (Ebates)
                            [created_by_alias] => Sears
                            [alias] => ebates-sears
                            [catid] => 13
                            [images] => {"image_intro":"","float_intro":"","image_intro_alt":"","image_intro_caption":"https:\/\/d2z2x9m6jf98op.cloudfront.net\/Large\/sears","image_fulltext":"","float_fulltext":"","image_fulltext_alt":"","image_fulltext_caption":"https:\/\/www.ebates.com\/sears.com?eeid=28187"}
                            [metakey] => Ebates
                        )

                )

        )

    [php_cards] => Array
        (
            [returned] => https://click.linksynergy.com/deeplink?id=JaPpwFNgpXE&mid=38426&murl=https%3A%2F%2Fwww.raise.com%2Fbuy-sears-gift-cards
            [var] => https://click.linksynergy.com/deeplink?id=JaPpwFNgpXE&mid=38426&murl=https%3A%2F%2Fwww.raise.com%2Fbuy-sears-gift-cards
        )

    [php_portal] => Array
        (
            [returned] => https://www.ebates.com/sears.com?eeid=28187
            [var] => https://www.ebates.com/sears.com?eeid=28187
        )

    [php_card_store] => Array
        (
            [returned] => https://dnrzlv4wd9rbi.cloudfront.net/assets/product-sources/105/medium/sears-gift-card.png?1441391953
            [var] => https://dnrzlv4wd9rbi.cloudfront.net/assets/product-sources/105/medium/sears-gift-card.png?1441391953
        )

    [php_portal_store] => Array
        (
            [returned] => https://d2z2x9m6jf98op.cloudfront.net/Large/sears
            [var] => https://d2z2x9m6jf98op.cloudfront.net/Large/sears
        )

    [php_ebates_store_image] => Array
        (
            [returned] => {var:php_portal_store}.jpg
            [var] => {var:php_portal_store}.jpg
        )

    [php_store_name] => Array
        (
            [returned] => {var:read_data26.load_fields2.created_by_alias}
            [var] => {var:read_data26.load_fields2.created_by_alias}
        )

    [php35_add_introtext] => Array
        (
            [returned] => 4
            [var] => 4
        )

    [php_steps] => Array
        (
            [returned] => 
<br>
<font size ='3'>
<b>Step 1</b> --  Go to <b><a href='{var:php_portal}' target='_blank'>{var:read_data17.load_fields.metakey}</b></a>, then make sure you are logged into your account and that you have disabled any AdBlocking software that you may have enabled<br><br>

<b>Step 2</b> -- Click on the 'Shop Now' button.  This 'portal' link will bring you directly to <b>{var:read_data17.load_fields.created_by_alias}</b> and allow you to earn up to <b>{var:read_data17.load_fields.introtext}%</b> just by clicking through<br><br>

<b>Step 3</b> -- Shop as you normally would at <b>{var:read_data17.load_fields.created_by_alias}</b> and save items to your cart but <font color='red'><u>Do Not</u></font> checkout unless you do not want additional savings<br><br>

<b>Step 4</b> -- Write down (or remember) the total in your cart at <b>{var:read_data17.load_fields.created_by_alias}</b> including tax and shipping<br><br>

<b>Step 5</b> -- Go to <a href='{var:php_cards}' target='_blank'><b>{var:read_data26.load_fields2.metakey}</b></a> to purchase discounted gift card(s) at up to <b>{var:read_data26.load_fields2.introtext}% off</b>.<br>

   <font size ='2'>-- Most stores allow you to use up to 4 different gift cards when checking out (check the website if you plan on using more)<br><br>
</font>

<b>Step 6</b> -- Return to <b>{var:read_data17.load_fields.created_by_alias}</b> and checkout as you normally would but remember to use your gift cards as your payment method<br><br>

Congratulations! You saved as much as <b>{var:php35_add_introtext}%</b> by spending a couple of extra minutes shopping!
</font>
            [var] => 
<br>
<font size ='3'>
<b>Step 1</b> --  Go to <b><a href='{var:php_portal}' target='_blank'>{var:read_data17.load_fields.metakey}</b></a>, then make sure you are logged into your account and that you have disabled any AdBlocking software that you may have enabled<br><br>

<b>Step 2</b> -- Click on the 'Shop Now' button.  This 'portal' link will bring you directly to <b>{var:read_data17.load_fields.created_by_alias}</b> and allow you to earn up to <b>{var:read_data17.load_fields.introtext}%</b> just by clicking through<br><br>

<b>Step 3</b> -- Shop as you normally would at <b>{var:read_data17.load_fields.created_by_alias}</b> and save items to your cart but <font color='red'><u>Do Not</u></font> checkout unless you do not want additional savings<br><br>

<b>Step 4</b> -- Write down (or remember) the total in your cart at <b>{var:read_data17.load_fields.created_by_alias}</b> including tax and shipping<br><br>

<b>Step 5</b> -- Go to <a href='{var:php_cards}' target='_blank'><b>{var:read_data26.load_fields2.metakey}</b></a> to purchase discounted gift card(s) at up to <b>{var:read_data26.load_fields2.introtext}% off</b>.<br>

   <font size ='2'>-- Most stores allow you to use up to 4 different gift cards when checking out (check the website if you plan on using more)<br><br>
</font>

<b>Step 6</b> -- Return to <b>{var:read_data17.load_fields.created_by_alias}</b> and checkout as you normally would but remember to use your gift cards as your payment method<br><br>

Congratulations! You saved as much as <b>{var:php35_add_introtext}%</b> by spending a couple of extra minutes shopping!
</font>
        )

)
Max_admin 11 Apr, 2019
Answer
1 Likes
Ok, please put your code in php tags <?php and ?> then place it in a "Custom code" action, does it work as expected ?

If yes then this is because of a recent update, PHP action should not return shortcodes.

Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.