- ๐ฌ๐งUnited Kingdom catch
Updated the issue title, this is just a straightforward deprecation now. Needs a re-roll updating the deprecation version.
- ๐ซ๐ทFrance andypost
Filed CR https://www.drupal.org/node/3384294 โ
and updated patch, looks there's no test for
uri_callback
annotation in comment entityAlso it needs update hook to clear entity definition cache, and let's see if something will be broken with deprecation only
Looking for better wording as
Comment::permalink()
is useless ๐ Rename Comment::permalink() to not be ambiguous with ::uri() Needs workThat's reason why issue used to have such title
- last update
over 1 year ago 30,098 pass - ๐ฌ๐งUnited Kingdom catch
Comment::permalink() isn't useless, it's necessary to link to a comment in the context of the thread (with the correct page and comment fragment). I think we can just tell people to use that until it's renamed. However why not recommend $comment->uri() here?
- ๐ฎ๐ณIndia samit.310@gmail.com
samit.310@gmail.com โ made their first commit to this issueโs fork.
- Status changed to Needs review
5 months ago 11:48am 5 September 2024 - ๐ฎ๐ณIndia samit.310@gmail.com
Hello,
The
comment_uri
function is only been used inuri_callback
comment entity's annotation.As per https://www.drupal.org/project/drupal/issues/2667040 ๐ Deprecate uri_callback in routes for entities Needs work ticket the uri_callback is also depricated.
In
template_preprocess_comment
hook$comment->permalink();
is already been used to generate Comment link.Thanks
Samit K. - Status changed to Needs work
5 months ago 1:12pm 5 September 2024 - ๐บ๐ธUnited States smustgrave
Title says to deprecate the function so that still needs to be done
- ๐ฎ๐ณIndia samit.310@gmail.com
Hi @smustgrave,
As per the changes record [#3384294] it is deprecated in 10.2.0 and will removed with 11.x, so i removed it for 11.x branch.
Thanks
Samit K. - ๐บ๐ธUnited States smustgrave
Yes but it got missed so now needs to be properly deprecated
- ๐ฎ๐ณIndia samit.310@gmail.com
Hi @smustgrave,
Updated the code based on your suggestion. Also updated the changes record [#3384294] โ .
Thanks
Samit K. - ๐บ๐ธUnited States smustgrave
Thanks only thing missing is a quick deprecation test
- ๐ฎ๐ณIndia samit.310@gmail.com
Hi @smustgrave,,
Test also added, Please review.
Thanks
Samit K. - ๐ฆ๐บAustralia larowlan ๐ฆ๐บ๐.au GMT+10
Couple of minor questions/nits on MR, thanks for keeping this moving
- First commit to issue fork.
- ๐ฎ๐ณIndia shalini_jha
I have reviewed all the feedback and made the necessary updates. After making the changes, I re-ran the tests, and This is working as expected. Moving this to NR for your review.
- ๐ฎ๐ณIndia shalini_jha
@smustgrave Thank you for the review & feedback , I have updated the test file name and comment for the test class, Accordingly updated the Phpstan baseline . Re-run test after these changes and working as expected. and pipeline is green so moving this again for your review.
Kindly review. - ๐บ๐ธUnited States smustgrave
Left 1 more comment on the thread started by @larowlan
- ๐ฎ๐ณIndia shalini_jha
Removed the comment on the return statement, as I believe it was not appropriate.
Kindly review. - ๐จ๐ญSwitzerland berdir Switzerland
This function is still referenced on the Comment entity type attribute as the uri callback, it should be removed there. https://git.drupalcode.org/project/drupal/-/blob/010bbc7476df8c23b0170f5...
- ๐ฎ๐ณIndia shalini_jha
@berdir Thank you for the feedback , I have removed the uri_callback and tested the functionality. It is working as expected. However, I am a bit unsure if there is anything else that needs to be updated related to this.
Moving this for NR , Kindly review.
- ๐จ๐ญSwitzerland berdir Switzerland
Yes, uri_callback has not actually been used in a very, very long time. If it would have been called, it would have triggered deprecation errors in the tests. Looking at \Drupal\Core\Entity\EntityBase::toUrl(), it only falls back to that if there are no link templates defined. Which isn't the case for the comment entity (or any other entity in core AFAIK).
- ๐บ๐ธUnited States smustgrave
Believe all feedback for this one has been addressed.
- ๐ณ๐ฟNew Zealand quietone
I read the IS, comments and the MR. This all looks good but I found some things that need work, so setting to NW. See the comments in the MR.
I am not sure about the removal of
uri_callback: 'comment_uri',
. I did read the comment from @berdir but it is used in entity.api.php and other files. I think that needs some investigation. - ๐จ๐ญSwitzerland berdir Switzerland
the proposed solution in the iS does need an update, but #72 explains why it's not called. uri_callback is a weird leftover from before we had link templates.
Entirely deprecating that concept is done in ๐ Deprecate uri_callback in routes for entities Needs work , this is just one specific dead configuration that is not used.