Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted February 22, 20222 yr 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?
February 22, 20222 yr Author @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, 20222 yr by ReyDev
February 22, 20222 yr Solution 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() );
February 23, 20222 yr 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.