ReyDev Posted February 22, 2022 Share Posted February 22, 2022 when I delete an item using the delete() method of conten\item class, the item is deleted but throws an exception with no message. why? Link to comment Share on other sites More sharing options...
Daniel F Posted February 22, 2022 Share Posted February 22, 2022 I can't reproduce this, what's the full error stack? Link to comment Share on other sites More sharing options...
ReyDev Posted February 22, 2022 Author Share Posted February 22, 2022 (edited) @Daniel F Request URL: *************** Request Method: GET Status Code: 500 Internal Server Error Remote Address: [::1]:80 Referrer Policy: strict-origin-when-cross-origin BadMethodCallException No message Stack frames (9) 8 BadMethodCallException *******\system\Content\Item.php1452 7 IPS\Content\_Item url *******\system\Content\Content.php2479 6 IPS\_Content adjustSessions *******\system\Content\Content.php409 5 IPS\_Content delete *******\system\Content\Item.php2587 4 IPS\Content\_Item delete *******\story\story.php242 3 IPS\valastory\modules\front\story\_story deleteStory *******\system\Dispatcher\Controller.php90 2 IPS\Dispatcher\_Controller execute *******\story\story.php36 1 IPS\valastory\modules\front\story\_story execute *******\system\Dispatcher\Dispatcher.php153 0 IPS\_Dispatcher run *******\index.php14 is the problem about the url() method ? I didn't implement this method! Edited February 22, 2022 by ReyDev Link to comment Share on other sites More sharing options...
Solution teraßyte Posted February 22, 2022 Solution Share Posted February 22, 2022 4 hours ago, ReyDev said: is the problem about the url() method ? I didn't implement this method! Yes. The delete function uses that method in the last line for the IndexNow service: \IPS\core\IndexNow::addUrlToQueue( $this->url() ); ReyDev 1 Link to comment Share on other sites More sharing options...
Daniel F Posted February 23, 2022 Share Posted February 23, 2022 Well, in theory an item needs to have a valid URL, but there are few cases where it's not going to be the case e.g. Records::url() can also throw an LogicException when the Record which is being deleted belongs to a database which isn't associated with any public page. That said, I have reported this to our internal bug tracker, so that we can investigate this further. Link to comment Share on other sites More sharing options...
Recommended Posts