Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I got the same error: Exception: String could not be parsed as XML в функции SimpleXMLElement->__construct() (строка 448 в файле /var/www/username/data/www/site.ru/sites/all/modules/yandex_webmaster/includes/yandex_webmaster.inc).
Could you please provide more details on this error? Did you get it on the screen when performing some actions? Then what actions were you doing?
Or did it get logged into the Drupal log? As if this is the case - then this is by design (and is exactly what was done in #1), these errors should be logged there - and they mean that smth went wrong when performing request to Yandex.
Потестировал и выснил, что на моем сайте ошибку Exception: String could not be parsed as XML в функции SimpleXMLElement->__construct() (строка 448 в файле /home/.../data/www/....ru/sites/all/modules/yandex_webmaster/includes/yandex_webmaster.inc).
кажется вызывает знак %
Например, вот такой текст в теле ноды приводит к ошибке "Почками выводится от 60 до 80%"
Но после сохранения ноды появилась ошибка, ее я не записал, но в логах друпало появилось сообщение:
Exception: String could not be parsed as XML в функции SimpleXMLElement->__construct() (строка 448 в файле /var/www/user/data/www/site.ru/sites/all/modules/yandex_webmaster/includes/yandex_webmaster.inc).
and got the same error but after google it 4-5 hrs on net i got a solution where i have just change the $data = simplexml_load_string($http_result->data); with $data = drupal_json_decode($data); and my error has gone.
Comments
Comment #1
duozerskEmilio,
Thanks for testing the module! I have added the additional checks on the drupal_http_request() error - it should prevent these warnings.
Commit - http://drupalcode.org/project/yandex_webmaster.git/commit/cdc78ab
Thanks
AndyB
Comment #1
duozerskDuplicate comment.
Comment #2
Plazik CreditAttribution: Plazik commentedI got the same error:
Exception: String could not be parsed as XML в функции SimpleXMLElement->__construct() (строка 448 в файле /var/www/username/data/www/site.ru/sites/all/modules/yandex_webmaster/includes/yandex_webmaster.inc).
Comment #3
duozerskNickolay,
Could you please provide more details on this error? Did you get it on the screen when performing some actions? Then what actions were you doing?
Or did it get logged into the Drupal log? As if this is the case - then this is by design (and is exactly what was done in #1), these errors should be logged there - and they mean that smth went wrong when performing request to Yandex.
Thanks
AndyB
Comment #4
Emilio13 CreditAttribution: Emilio13 commentedПотестировал и выснил, что на моем сайте ошибку
Exception: String could not be parsed as XML в функции SimpleXMLElement->__construct() (строка 448 в файле /home/.../data/www/....ru/sites/all/modules/yandex_webmaster/includes/yandex_webmaster.inc).
кажется вызывает знак %
Например, вот такой текст в теле ноды приводит к ошибке "Почками выводится от 60 до 80%"
Comment #5
Emilio13 CreditAttribution: Emilio13 commentedВ логах модуля вот такая ошибка:
Yandex.Webmaster original texts request to https://webmaster.yandex.ru/api/v2/hosts/19604573/original-texts/ failed with code 405.
Comment #6
Plazik CreditAttribution: Plazik commentedЯ сделал такое Правило http://s005.radikal.ru/i209/1312/92/4645dc107a15.png
Т.е. после сохранения документа отправлять текст в Яндекс.
Но после сохранения ноды появилась ошибка, ее я не записал, но в логах друпало появилось сообщение:
Exception: String could not be parsed as XML в функции SimpleXMLElement->__construct() (строка 448 в файле /var/www/user/data/www/site.ru/sites/all/modules/yandex_webmaster/includes/yandex_webmaster.inc).
Comment #7
duozerskEmilio, Nickolay,
Thank you for coming back with this, it looks like I forgot to implement the URL-encoding of the data sent as the original text.
It should be fixed here - http://drupalcode.org/project/yandex_webmaster.git/commit/d746fc7 - please get the snapshot code from there (http://drupalcode.org/project/yandex_webmaster.git/snapshot/d746fc7.tar.gz) and test it out.
AndyB
Comment #8
Plazik CreditAttribution: Plazik commentedduozersk, it works for me now. Thank you.
Comment #9
duozerskComment #11
Manav CreditAttribution: Manav as a volunteer commentedHi Emilio13,
I got the same error in my custom module and finally i got the solution for this basically i was using this
and got the same error but after google it 4-5 hrs on net i got a solution where i have just change the
$data = simplexml_load_string($http_result->data);
with$data = drupal_json_decode($data);
and my error has gone.