Bug "View" event trigger not apply to transactions!

Status
Not open for further replies.

e-Dewan

Customer
Hi Dragons 🐉,

screenshot-www.e-dewan.com-2021.07.25-01_43_07.png

As you see on the above screenshot,
"View" event is triggered, But not calculated to the total balance amount!
I have double checked all settings including "View" events settings and all correct and same as other events.

DragonByte Credits 5.7.3.1
Xenforo v2.2.5


Also I have created a wallet widget to display a specific currency, But the widget always display either the all currency or the 1st currency I created, How can I only display the 2nd currency only?
I already choose to display the 2nd currency only in the widget sitting but not working
screenshot-www.e-dewan.com-2021.07.25-01_53_06.png
(ACP is dark themed)
 
Help!! Every member is complaining in my forums about this issue.
I hope every one in DragoneByte is ok.
 
I don't have any new information to share at this time. I will let you know if I'm able to reproduce it and if not, if I need any additional information.
 
I've paid $80 to a developer to fix these 2 issues. Making me rethink & reconsidering about next renewal of your add-ons.



Here is what developer did to fix the bugs.

DragonByte Wallet issue:
Wallet not showing correct selected currency.

Reason:
Values against select options are not correct... And its a really bad approach that has been used, it creates more and more conflicts if used more currencies...

Solution:
Passed correct parameters to the widget template and used them in a correct way.

Changes:
1. DBTech\Credits\Widget\Wallet:
Replace
Code:
protected function getDefaultTemplateParams($context): array
    {
        $params = parent::getDefaultTemplateParams($context);
        if ($context == 'options')
        {
            $params['currencies'] = $this->finder('DBTech\Credits:Currency')
                ->fetch()
                ->pluckNamed('title')
            ;
        }
        return $params;
    }

With
Code:
protected function getDefaultTemplateParams($context): array
    {
        $params = parent::getDefaultTemplateParams($context);
        if ($context == 'options')
        {
            $params['currencies'] = $this->finder('DBTech\Credits:Currency')
                ->fetch()
            ;
        }
        return $params;
    }

2. Template(widget_def_options_dbtech_credits_wallet):

Replace
Code:
<hr class="formRowSep" />

<xf:selectrow label="{{ phrase('dbtech_credits_currency_limit') }}" name="options[currencyIds][]" value="{{ $options.currencyIds ?: '' }}" multiple="multiple" size="7">
    <xf:option value="">{{ phrase('dbtech_credits_all_currencies') }}</xf:option>

    <xf:options source="$currencies" />

    <xf:explain>{{ phrase('dbtech_credits_only_include_selected_currencies') }}</xf:explain>
</xf:selectrow>

With
Code:
<hr class="formRowSep" />



<xf:selectrow label="{{ phrase('dbtech_credits_currency_limit') }}" name="options[currencyIds][]" value="{{ $options.currencyIds ?: '' }}" multiple="multiple" size="7">

    <xf:eek:ption value="">{{ phrase('dbtech_credits_all_currencies') }}</xf:eek:ption>

    <xf:foreach loop="$currencies" value="$currency">

        <xf:eek:ption value="{$currency.currency_id}">{$currency.title}</xf:eek:ption>

    </xf:foreach>

  



    <xf:explain>{{ phrase('dbtech_credits_only_include_selected_currencies') }}</xf:explain>

</xf:selectrow>



DragonByte Viewed Event Points Issue:

Reason:

bad query in Transaction Entity if 'Disallow negative currency' option is selected in currency.

Code:
if (!$this->Currency->negative)
            {
                // Update the currency table, but ensure it resets to 0 if needed
                $this->db()->query('
                    UPDATE xf_user
                    SET ' . $this->Currency->column . ' = GREATEST(0, CAST(' . $this->Currency->column . ' AS SIGNED) + ?)
                    WHERE user_id = ?
                ', [
                    $this->amount,
                    $this->user_id
                ]);
            }

Solution:
We don't have the need to select this option so we have changed it to 'Allow negative display' for now. When they fix, you can choose anyone.

the error is attached below.
 

Attachments

  • screenshot-www.e-dewan.com-2021.08.06-20_16_12.png
    screenshot-www.e-dewan.com-2021.08.06-20_16_12.png
    368.4 KB · Views: 3
DragonByte Wallet issue:
Wallet not showing correct selected currency.

Reason:
Values against select options are not correct... And its a really bad approach that has been used, it creates more and more conflicts if used more currencies...

Solution:
Passed correct parameters to the widget template and used them in a correct way.
This solution is over-engineered. The real fix is to change line 34 to ->pluckNamed('title', 'currency_id').

---
I would prefer it if you kept insulting statements out of future posts, as it's making it much harder for me to assist you further.
 
Status
Not open for further replies.

DragonByte Credits

XenForo 1.5.3+ XenForo 2.0.x XenForo 2.1.x XenForo 2.2.x
Seller
DragonByte Technologies
Release date
Last update
Total downloads
4,261
Customer rating
5.00 star(s) 4 ratings
Back
Top