Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Undefined array key "result"

Đang mở
#518 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
php
Lĩnh vực
api, backend

Hướng nghiên cứu

Start at Parse/ParseCloud.php line 39 and trace the response returned by ParseClient::_request for the reported ParseCloud::run calls. Reproduce with Parse PHP SDK 2.3.2, PHP 8.2, and Parse Server 7.0.0; done means the warning no longer occurs while failed requests still report their errors.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

type:feature
New Issue Checklist
Issue Description

PHP throws the following warning whenever I use Parse server:

2024-06-04 17:49:24 NOTICE: PHP message: PHP Warning:  Undefined array key "result" in /code/vendor/parse/php-sdk/src/Parse/ParseCloud.php on line 39

It's not fatal, but I feel like it should be a pretty simple fix to avoid. Seems to be possibly related to #517.

Steps to reproduce

Simplified version of my code:

$httpClient = \Parse\ParseClient::getHttpClient();
$httpClient->setup();
$response = $httpClient->send($fileUrl);

\Parse\ParseCloud::run("coreSavingSourceData", ["sourceId" => $source->getObjectId()], true);
\Parse\ParseCloud::run("sendImportDataToParsers", [
  "sourceId" => $source->getObjectId(),
  "locationId" => $source->get("location")->getObjectId(),
  ...
], true);

foreach ($sourceData as $type => $parseObjects) {
  foreach (array_chunk($parseObjects, BATCH) as $chunk) {
    $source->fetch(true);
    if (!$source->get("isUploadCancelled")) {
      try {
        \Parse\ParseObject::saveAll($chunk, true, BATCH);
      } catch (\Parse\ParseAggregateException $e) {
        $errors = array_map(fn($er) => $er["error"], $e->getErrors());
        error_log(print_r($errors, true));
      }
    } else {
      throw new \Error("Upload cancelled");
	}
  }
}

$source->set("dataoneCount", count($sourceData["dataone"]));
$source->set("datatwoCount", count($sourceData["datatwo"]));
$source->save(true);
Environment

Parse PHP SDK

  • SDK version: 2.3.2
  • PHP version: 8.2

Server

  • Parse Server version: 7.0.0
  • Operating system: php:8.2-fpm Docker container
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Local (Docker)

Database

  • System (MongoDB or Postgres): mongo:6 Docker container
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): Local (Docker)
Logs
2024-06-04 16:23:28 [04-Jun-2024 20:23:28] NOTICE: fpm is running, pid 8
2024-06-04 16:23:28 [04-Jun-2024 20:23:28] NOTICE: ready to handle connections
2024-06-04 17:41:42 NOTICE: PHP message: PHP Warning:  Undefined array key "result" in /code/vendor/parse/php-sdk/src/Parse/ParseCloud.php on line 39
2024-06-04 17:51:20 NOTICE: PHP message: PHP Fatal error:  Uncaught Parse\ParseException: Object not found. in /code/vendor/parse/php-sdk/src/Parse/ParseClient.php:610
2024-06-04 17:51:20 Stack trace:
2024-06-04 17:51:20 #0 /code/vendor/parse/php-sdk/src/Parse/ParseObject.php(561): Parse\ParseClient::_request('GET', 'classes/Source/...', NULL, NULL, true)
2024-06-04 17:51:20 #1 /code/src/Import/baseImporter.php(285): Parse\ParseObject->fetch(true)
2024-06-04 17:51:20 #2 /code/src/Import/ciscoconfig.php(666): PROJECT\Import\baseImporter->saveDataInParse(Array)
2024-06-04 17:51:20 #3 /code/src/Import/baseImporter.php(56): PROJECT\Import\ciscoconfig->import()
2024-06-04 17:51:20 #4 /code/src/Controllers/ImportController.php(49): PROJECT\Import\baseImporter->__construct(Array, Object(Pimple\Container))
2024-06-04 17:51:20 #5 /code/index.php(29): PROJECT\Controllers\ImportController->processRequest()
2024-06-04 17:51:20 #6 {main}
2024-06-04 17:51:20   thrown in /code/vendor/parse/php-sdk/src/Parse/ParseClient.php on line 610
2024-06-04 17:51:20 127.0.0.1 -  04/Jun/2024:21:41:41 +0000 "POST /index.php" 200
2024-06-04 17:51:20 NOTICE: PHP message: Uncaught Parse\ParseException: Object not found. in /code/vendor/parse/php-sdk/src/Parse/ParseClient.php:610
2024-06-04 17:51:20 Stack trace:
2024-06-04 17:51:20 #0 /code/vendor/parse/php-sdk/src/Parse/ParseObject.php(561): Parse\ParseClient::_request('GET', 'classes/Source/...', NULL, NULL, true)
2024-06-04 17:51:20 #1 /code/src/Import/baseImporter.php(285): Parse\ParseObject->fetch(true)
2024-06-04 17:51:20 #2 /code/src/Import/ciscoconfig.php(666): PROJECT\Import\baseImporter->saveDataInParse(Array)
2024-06-04 17:51:20 #3 /code/src/Import/baseImporter.php(56): PROJECT\Import\ciscoconfig->import()
2024-06-04 17:51:20 #4 /code/src/Controllers/ImportController.php(49): PROJECT\Import\baseImporter->__construct(Array, Object(Pimple\Container))
2024-06-04 17:51:20 #5 /code/index.php(29): PROJECT\Controllers\ImportController->processRequest()
2024-06-04 17:51:20 #6 {main}
2024-06-04 17:51:20   thrown
2024-06-04 17:51:20 NOTICE: PHP message: PHP Fatal error:  Uncaught Parse\ParseException: Object not found. in /code/vendor/parse/php-sdk/src/Parse/ParseClient.php:610
2024-06-04 17:51:20 Stack trace:
2024-06-04 17:51:20 #0 /code/vendor/parse/php-sdk/src/Parse/ParseCloud.php(31): Parse\ParseClient::_request('POST', 'functions/impor...', NULL, '{"sourceId":"Ue...', true)
2024-06-04 17:51:20 #1 /code/src/Import/baseImporter.php(314): Parse\ParseCloud::run('importFailed', Array, true)
2024-06-04 17:51:20 #2 [internal function]: PROJECT\Import\baseImporter->triggerFailedImport('Ue4GHlTWVm')
2024-06-04 17:51:20 #3 {main}
2024-06-04 17:51:20   thrown in /code/vendor/parse/php-sdk/src/Parse/ParseClient.php on line 610
Ngôn ngữ chính
PHP
Star
808
Fork
341
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của parse-community/parse-php-sdk

Tất cả issue của parse-community/parse-php-sdk

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.