Problem/Motivation

Hi!
We are trying to upgrade from PHP 7.4 to PHP 8.0, a Drupal 7.92 site.
But when we vote a content, the vote is counted, but the page redirects to something like this:
https://MYSITE/lang/content_type/undefined thats end in a 404 page.
instead of
https://MYSITE/lang/content_type/title_of_content.
In PHP 7.4 works as expected

Steps to reproduce

PHP 8.0
Voting API 7.x-2.15
FiveStar 7.x-2.2

Any idea how to fix?

Regards,
Jordi
JOINSO

Comments

JOINSO created an issue. See original summary.

tr’s picture

Category: Bug report » Support request
Status: Active » Postponed (maintainer needs more info)

But when we vote a content

What does this mean? Voting API is a framework. It doesn't provide a way to vote (other than programmatically) and doesn't do any redirects. You are using some other module to allow users to vote on content, and that other module or some other method is doing the redirects.

joinso’s picture

Sorry for the confusion.
The issue is in Fivestar.

tr’s picture

Fivestar doesn't do any redirects either.

joinso’s picture

Yes:
In fivestar/js/fivestar.ajax.js:

(function($){ // Create local scope.

Drupal.ajax.prototype.commands.fivestarUpdate = function (ajax, response, status) {
response.selector = $('.fivestar-form-item', ajax.element.form);
ajax.commands.insert(ajax, response, status);
$url=$("#fivestar-custom-widget").attr('action');
document.location=$url;
};

})(jQuery);

Yes, you are right, FiveStar does not do redirects.

joinso’s picture

Hi!

We can close this issue.
This is not related to PHP 8 and/or Voting API.

Regards,
Jordi
JOINSO

tr’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

As per #6.