Please help:
If I like a user comment the opened modal (Members who liked this comment) shows zero member and no like is counted.
In th blog I'm getting the following message:

Notice: Array to string conversion in Drupal\Component\Render\PlainTextOutput::renderFromHtml() (Zeile 22 in ...../html/core/lib/Drupal/Component/Render/PlainTextOutput.php) #0 ...../html/core/includes/bootstrap.inc(584): _drupal_error_handler_real(8, 'Array to string...', '/home/www/doc/2...', 22, Array) #1 ...../html/core/lib/Drupal/Component/Render/PlainTextOutput.php(22): _drupal_error_handler(8, 'Array to string...', '/home/www/doc/2...', 22, Array) #2 ...../html/core/lib/Drupal/Core/Ajax/OpenDialogCommand.php(74): Drupal\Component\Render\PlainTextOutput::renderFromHtml(Array) #3 ...../html/core/lib/Drupal/Core/Ajax/OpenModalDialogCommand.php(35): Drupal\Core\Ajax\OpenDialogCommand->__construct('#drupal-modal', Array, Object(Drupal\Core\Render\Markup), Array, NULL) #4 ...../html/core/lib/Drupal/Core/Render/MainContent/ModalRenderer.php(36): Drupal\Core\Ajax\OpenModalDialogCommand->__construct(Array, Object(Drupal\Core\Render\Markup), Array) #5 ...../html/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\ModalRenderer->renderResponse(Array, Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\CurrentRouteMatch)) #6 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object(Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher)) #7 ...../html/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher)) #8 ...../vendor/symfony/http-kernel/HttpKernel.php(156): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object(Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent)) #9 ...../vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #10 ...../html/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #11 ...../html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #12 ...../html/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #13 ...../html/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #14 ...../html/core/modules/ban/src/BanMiddleware.php(50): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #15 ...../html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\ban\BanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #16 ...../html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #17 ...../vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #18 ...../html/core/lib/Drupal/Core/DrupalKernel.php(693): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #19 ...../html/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #20 {main}.

Comments

quixxel created an issue. See original summary.

Raman Starshykh’s picture

Issue tags: +epam-contrib-2019.03
linichalexey’s picture

Issue tags: -epam-contrib-2019.03
jaapjan’s picture

Could you post some more information? As which user did you do this? Do you perhaps have a screenshot?

quixxel’s picture

regardless of whether I'm logged in as an admin, a normal user or anonymous it does't work.
As an anonymous only the hart color changes to red and it grows a little bit and »Like« isn't visible as a link.
As a user I can click the »like« and the modal shows the following:

Screenshot Modal

Do you nneed more info?

jaapjan’s picture

Does the like actually gets added in the database?

Could you check if the like on the comment is in these tables:

  • votingapi_vote
  • votingapi_result

If it's not in there then something went wrong while adding the like.

quixxel’s picture

Okay thanx for the advice. There are no tables
• votingapi_vote
• votingapi_result
in the db.

Voting API is activated by install process with Demo content and also the social like module is activated.
I configured it on
.../admin/config/search/votingapi/like_and_dislike
Do you have a suggestion what to do?

jaapjan’s picture

Category: Bug report » Support request

Hmm that is strange. Did you get any errors during the installation? It seems that the installation wasn't completed correctly then. Perhaps try to re-install votingapi module?

If that doesn't help perhaps you could try to run this function for votingapi in a custom script or via drush ev: https://api.drupal.org/api/drupal/core%21includes%21schema.inc/function/...

quixxel’s picture

Sorry, I looked into wrong db.
The tables
• votingapi_vote
• votingapi_result
are existing in the db. And what should I find in there?

On the other hand: I tried another install – fresh and local.
And also I got the same issue there: its not possible to like.
I then installed the blog module and nothing else and found the following similar (not identical) error like in opening statement.
So it seems that this is a generally issue.
Maybe someone else could proove this?

Notice: Array to string conversion in Drupal\Component\Render\PlainTextOutput::renderFromHtml() (Zeile 22 in ...../html/core/lib/Drupal/Component/Render/PlainTextOutput.php) #0 ...../html/core/includes/bootstrap.inc(584): _drupal_error_handler_real(8, 'Array to string...', '/Users/quixxel/...', 22, Array) #1 ...../html/core/lib/Drupal/Component/Render/PlainTextOutput.php(22): _drupal_error_handler(8, 'Array to string...', '/Users/quixxel/...', 22, Array) #2 ...../html/core/lib/Drupal/Core/Ajax/OpenDialogCommand.php(74): Drupal\Component\Render\PlainTextOutput::renderFromHtml(Array) #3 ...../html/core/lib/Drupal/Core/Ajax/OpenModalDialogCommand.php(35): Drupal\Core\Ajax\OpenDialogCommand->__construct('#drupal-modal', Array, Object(Drupal\Core\Render\Markup), Array, NULL) #4 ...../html/core/lib/Drupal/Core/Render/MainContent/ModalRenderer.php(36): Drupal\Core\Ajax\OpenModalDialogCommand->__construct(Array, Object(Drupal\Core\Render\Markup), Array) #5 ...../html/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\ModalRenderer->renderResponse(Array, Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\CurrentRouteMatch)) #6 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object(Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher)) #7 ...../html/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher)) #8 ...../vendor/symfony/http-kernel/HttpKernel.php(156): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object(Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent)) #9 ...../vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #10 ...../html/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #11 ...../html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #12 ...../html/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #13 ...../html/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #14 ...../html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #15 ...../html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #16 ...../vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #17 ...../html/core/lib/Drupal/Core/DrupalKernel.php(693): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #18 ...../html/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #19 {main}.

quixxel’s picture

In a new fresh install of social-8.x-4.7 I applied the patch #52 of https://www.drupal.org/project/drupal/issues/2663316
and the notice from above „Array to string conversion....“ which results by clicking a like button was gone.

But again as before: no new like is shown in the modal or counted in the db.

Please help !!

jaapjan’s picture

Good to hear the message is gone, but sad to hear you still encounter the issue.

I see you use German language. Have you also tried on an English installation? Curious to hear if that works.

quixxel’s picture

Okay, I installed a fresh social-8.x-4.8 english version – the same result: I can see the voting results in the demo content (and in the db) but the »Like« of mine isn't added.
Then I installed a fresh social-8.x-4.8 without demo content – same issue. Both db voting fields still stay empty if I use the like button.
Other ideas?

ronaldtebrake’s picture

Hi quixxel,

Do you maybe have the following information for us?
- What do u use for a development environment / where do you host this?
- Any JS errors after clicking the like button?

screenshot

There should be an Ajax request going towards your server similar to the above
(it's a GET but https://www.drupal.org/node/2848205 will make sure it's a POST)

Could you see if thats the case?

quixxel’s picture

Hi,
I tried the fresh installs via composer first on my local mac and then also on a shared host with:
Datenbankserver-Version: MySQL 5.6.40
Perl-Version: 5.20.2
Python-Version: 2.7.9
ImageMagick-Version: 6.8.9-9

Both with same results.

See screenshots which are showing that its a POST

screen1
screen2

quixxel’s picture

Do you need more info?

ronaldtebrake’s picture

Unfortunately the only I see here is that the call from the frontend to the server is coming through OK and it gets (an empty but good) response.

Sorry it's so difficult to grasp but if you could make screenshots of the entire process before this that would be perfect.
Being:

1. From the Ajax call after you click the like, should be a GET towards: 'like_and_dislike/' + entity_type + '/' + tag + '/' + entity_id

This should also give a 200 OK

2. The data inside the table after this for the following tables

• votingapi_vote
• votingapi_result

There should be an entry now after you clicked.

If that's not the case could you check your database logging to see if any logs were added?

quixxel’s picture

One step further:
Like and dislike and OpenSocial are working together only by using like_and_dislike 8.x-1.0-alpha2.
Not with alpha-3 and not with beta-1.
I thing its an ajax modal issue.

jaapjan’s picture

Status: Active » Closed (works as designed)
Related issues: +#3004793: Updated like_and_dislike from 1.0-alpha2 to 1.0-beta1

We limit versions of some contributed modules for a reason. We can only ensure that those versions work well with OS. Especially if modules are still in alpha or beta we can be fairly certain that updates might break stuff. There is already an issue to update the given module.. https://www.drupal.org/project/social/issues/3004793