Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error getVoter() must be an instance of Thucke\ThRating\Domain\Model\Voter #133

Open
2 tasks
linawolf opened this issue Jun 7, 2021 · 10 comments
Open
2 tasks

Comments

@linawolf
Copy link

linawolf commented Jun 7, 2021

Bug Report

Prerequisites

  • [x ] Can you reproduce the problem on TYPO3 v9.5 LTS
  • Can you reproduce the problem on TYPO3 v10.4 LTS
  • Did you perform a cursory search to see if your bug or feature is already reported?

Might be related to #68

Description

When calling my news item in which I included the rating template I get the following:

(1/1) TypeError
Return value of Thucke\ThRating\Domain\Model\Vote::getVoter() must be an instance of Thucke\ThRating\Domain\Model\Voter, null returned

in /var/www/html/private/typo3conf/ext/th_rating/Classes/Domain/Model/Vote.php line 169

Steps to Reproduce

  1. Install Extension and include templates,
  2. Create a rating object with 2 steps, table tx_news, field uid
  3. include the following into the news template::

<f:format.raw>
<thr:rating ratetable="tx_news" ratefield="uid" ratedobjectuid="{newsItem.uid}" ></thr:rating>
</f:format.raw>

Expected behavior: news with voting displayed

**Actual behavior:**error message

Versions

typo3/cms-core v9.5.25
georgringer/news 8.5.2
thucke/th-rating 1.8.3

@thucke
Copy link
Contributor

thucke commented Jun 7, 2021 via email

@linawolf
Copy link
Author

linawolf commented Jun 8, 2021

Ich habe folgende Konstanten gesetzt:

plugin.tx_thrating.config.loadJQuery = 0
plugin.tx_thrating.settings.pluginStoragePid = 62

mapanonymos hatte ich nicht gesetzt. Ich habe es mit

plugin.tx_thrating.settings.mapAnonymous = 1

versucht, der Fehler bleibt bestehen

@linawolf
Copy link
Author

linawolf commented Jun 8, 2021

I tried using the current master of this project instead and I get another error:

(1/1) #1476107295 TYPO3\CMS\Core\Error\Exception
PHP Warning: Use of undefined constant JSON_THROW_ON_ERROR - assumed 'JSON_THROW_ON_ERROR' (this will throw an Error in a future version of PHP) in /var/www/html/private/typo3conf/ext/th_rating/Classes/Service/JsonService.php line 35

@linawolf
Copy link
Author

linawolf commented Jun 8, 2021

using master - and using PHP 7.4 to prevent the above error I can open the news page containing the viewhelper. I don't see any ratings yet which might be another problem though.

Unfortunate we only have PHP 7.2 available on the customer server...

@thucke
Copy link
Contributor

thucke commented Jun 9, 2021

First: Sorry for the german tongue in my prior message ;-)

Unfortunately support for PHP 7.2 has dropped with version 1.9 of the extension.

Anyway - it should work in your constellation using version 1.8.3.

Please check if the following is set correctly and points to the page where the webusers are stored:

plugin.tx_felogin_pi1.storagePid

@linawolf
Copy link
Author

We don't have any fe users

@thucke
Copy link
Contributor

thucke commented Jun 11, 2021 via email

@linawolf
Copy link
Author

Seems like I missed this part: I do need an fe_user even if I want to have anonymos voting?

@thucke
Copy link
Contributor

thucke commented Jun 18, 2021

Yes, that's right.
But it's really only a dummy user because every vote requires a valid FE user.
There's no need that one should do a logon or something like that.
Because of that I'd suggest to set a maximum complex password (which could be forgotten immediately) for him.

I'll think about if I implement the automatic setup of such a user. It seems that replacing the current manual setup could make Rating AX a bit more comfortable to use.

@linawolf
Copy link
Author

Ill have another look into it. I've been unwell this week due to my Covid Vaccine and the heat. So I have not been working on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants