Support User Upgrade Duration and Gift Upgrades

pvpers

Licensed
Licensed
Hide BB Code
User Upgrade Duration
Joined
Jun 23, 2024
Messages
14
Reaction score
1
Hello,

Can you provide support for these two plugins to work together smoothly?
I can send you the Gift Upgrades plugin file for you to try.

Log error records :
PHP:
ErrorException: Fatal Error: Declaration of XenSoluce\UserUpgradeDuration\NF\GiftUpgrades\ControllerPlugin\Gift::actionGift(XF\Mvc\Entity\Entity $entity, $options = []) must be compatible with NF\GiftUpgrades\ControllerPlugin\Gift::actionGift(XF\Mvc\Entity\Entity $entity, array $options = []): XF\Mvc\Reply\AbstractReply src/addons/XenSoluce/UserUpgradeDuration/NF/GiftUpgrades/ControllerPlugin/Gift.php:19

Superclass or Interface Signature:
Code:
NF\GiftUpgrades\ControllerPlugin\Gift::actionGift(
    XF\Mvc\Entity\Entity $entity,
    array $options = []
): XF\Mvc\Reply\AbstractReply

Subclass Signature (Incorrect):
Code:
XenSoluce\UserUpgradeDuration\NF\GiftUpgrades\ControllerPlugin\Gift::actionGift(
    XF\Mvc\Entity\Entity $entity,
    $options = []
)

Source of the Problem
array $options Definition is Missing: The array type is not specified in the subclass.
Return Type is Missing: The return type specified as XF\Mvc\Reply\AbstractReply in the superclass is not included in the subclass.

I have told you what I know. I thank you in advance. I wish you good work.

I encountered an issue while using the [Xen-Soluce] User Upgrade Duration add-on. The error is caused by a method signature mismatch, as shown below:

Code:
Declaration of XenSoluce\UserUpgradeDuration\NF\GiftUpgrades\ControllerPlugin\Gift::actionGift(XF\Mvc\Entity\Entity $entity, $options = []) must be compatible with NF\GiftUpgrades\ControllerPlugin\Gift::actionGift(XF\Mvc\Entity\Entity $entity, array $options = []): XF\Mvc\Reply\AbstractReply

The issue is that the actionGift method in the XenSoluce\UserUpgradeDuration\NF\GiftUpgrades\ControllerPlugin\Gift class is not fully compatible with the method signature in the NF\GiftUpgrades\ControllerPlugin\Gift class.

In the parent class, the method is defined as follows:

Code:
public function actionGift(Entity $entity, array $options = []): AbstractReply

However, in your add-on, it is defined as:

Code:
public function actionGift(Entity $entity, $options = [])

To fix the issue, I made the following changes:

Added array type to the $options parameter.
Defined the return type as : AbstractReply.
The corrected code:

Code:
public function actionGift(Entity $entity, array $options = []): AbstractReply

With this fix, the issue has been resolved. I believe this adjustment should be included in the next version of your add-on.

Thank you.

But after everything, it wants to select a time period during purchase. It gives an error because we cannot make a selection on that screen.

1734269073654.png


Sorry for spamming.
 
Hello,

this is recent it is add "array"
Which version of the gift addon do you use?

You can try putting this just above the function :
PHP:
#[\ReturnTypeWillChange]
While leaving as is

Regarcs, CRUEL-MODZ
 
Hello,
2.2.15 im usin on xF
user upgrade duration : 2.1.2 fix 4

Can you tell me where in which file should I add it?
If you give me details I can do it. Thank you
 
In : XenSoluce\UserUpgradeDuration\NF\GiftUpgrades\ControllerPlugin\Gift

function : actionGift

Ok it useless btw
 
I haven't edited what you wrote yet. Should I not?
No, it doesn't matter, I've just tested it

the only problem I see is that if I update the addon, the old version of the gif addon will get the same error, which means that the addon will be dependent on the new version of this addon.
 
Please correct me if I misunderstood. If you edit now everyone will have to buy(renew) your new update, right? For it to work with the Gift plugin.
 
Please correct me if I misunderstood. If you edit now everyone will have to buy(renew) your new update, right? For it to work with the Gift plugin.
The problem is with the latest version of the gift addon, so if you're using an older version of git, no problem no need to renew the addon, but if you're using the latest version of gift yes you will.

On the other hand, if you want to update to the new version of user upgrade duration and you're using an older version of the gift addon, you'll need to update the gift addon.
 
I understand you.
I am willing to renew your plugin. I am using the latest version of the Gift plugin.
 
Back
Top Bottom