plesk / plesk/api-php-lib

notice with failed request

Open
#55 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
157
Forks
79
PR merge metrics
No merged PRs in 30d

Description

Hi,

I am getting a notice with a seeminlgy failed request:

Notice: Undefined offset: 0 in C:\DEV\sites\tools-si\vendor\plesk\api-php-lib\src\Api\Client.php on line 163

dumping the $xml variable yields the following:
object(PleskX\Api\XmlResponse)[475]
public '@attributes' =>
array (size=1)
'version' => string '1.6.9.0' (length=7)
public 'site' =>
object(PleskX\Api\XmlResponse)[241]
public 'get' =>
object(PleskX\Api\XmlResponse)[474]

there is no 'result' attribute under 'get'

Here's my request:




PARENT_NAME


<gen_info />



<disk_usage />



with PARENT_NAME being the name of a webspace as speciefied by the guide: https://docs.plesk.com/en-US/onyx/api-rpc/about-xml-api/reference/managing-sites-domains/available-filters.66544/

plesk version for this server is 17.0

running with "plesk/api-php-lib": "1.0.4" in composer.json

It would be awesome for all these info to be available with php and not though requests

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at src/Api/Client.php line 163 and reproduce the request against the Plesk 17.0 API using the XML shown in the report. Compare the response without a result attribute with the Plesk XML API documentation; the issue is resolved when this response is handled without an undefined-offset notice and the expected behavior is verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.