Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

ERROR on abstract-wc-rest-crud-controller.php:358 #13

@erikdemarco

Description

@erikdemarco
352:        public function get_items( $request ) {
353:            $query_args    = $this->prepare_objects_query( $request );
354:            $query_results = $this->get_objects( $query_args );
355:    
356:            $objects = array();
357:            foreach ( $query_results['objects'] as $object ) {
358:                if ( ! wc_rest_check_post_permissions( $this->post_type, 'read', $object->get_id() ) ) {
359:                    continue;
360:                }
361:    
362: 

the $object on line 357 should be validated first. If not sometimes it will show error when $object is not the value we expected.

Error: Call to a member function get_id() on boolean (line 358)

Metadata

Metadata

Assignees

Labels

bugIssue that can be reproduced.has pull requestIssue that has pull request.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions