Problem/Motivation

unicode_requirements() is just a helper for system_requirements().

Proposed resolution

Move or copy the logic to system_requirements().

Deprecate unicode_requirements() for removal in 9.x, although in this case we might be able to get away with removing it in a minor since it should never, ever be called.

Remaining tasks

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

catch created an issue. See original summary.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Alka Kumari’s picture

Assigned: Unassigned » Alka Kumari
Alka Kumari’s picture

I have brought the unicode_requirements() logic to system_requirements() in the patch.

catch’s picture

While the chances of this being called are slim, we should do the following:

1. Copy the function contents over, as is done here
2. Leave the old function as is, but add deprecation notices per https://www.drupal.org/core/deprecation

Alka Kumari’s picture

@catch How to find out nid for "@see http://drupal.org/node/the-change-notice-nid" ?

Alka Kumari’s picture

Patch including deprecation notice.

catch’s picture

Title: Move unicode_requirements() to system module » Inline unicode_requirements() in system_requirements()

Going to discuss the deprecation with @xjm a bit more, it's a shame we have to leave the copy - thanks for re-rolling with that in though.

More of an issue, we should inline the logic inside system_requirements() - the issue summary says this but the title isn't clear.

catch’s picture

Status: Needs review » Needs work
xjm’s picture

BTW, the patch in #8 is also not correct. It still removes the old function, and puts the deprecation notice on the new function. Neither of those things are things that we want. :)

We need to leave unicode_requirements() in place, follow the full deprecation policy for it (reference: https://www.drupal.org/core/deprecation) and then (unfortunately, as above) copy the code and just inline it where it's called in system.install.

Thanks!

xjm’s picture

Oh, @Alka Kumari, for your question about how to get the node ID of the change record. Since we are adding the deprecation in this issue, we will need to create the change record here in this issue as well. Here's our handbook page on how to create change records for issues: https://www.drupal.org/contributor-tasks/draft-change-record

pk188’s picture

Status: Needs work » Needs review
Issue tags: -deprecated
FileSize
3.83 KB

Re rolled #5 and fixed #6.

xjm’s picture

Status: Needs review » Needs work

Thanks! A few more things.

  1. +++ b/core/includes/unicode.inc
    @@ -10,7 +10,15 @@
    + * @deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0.
    + * @see https://www.drupal.org/node/2764821
    

    It wasn't deprecated in 8.0.0; it's being deprecated for 8.4.0.

    Also, minor nit: There should be a blank line between the @deprecated and @see.

    Finally, this should include exactly the same text as the @trigger_error(), except with the documentation tags instead of words. See https://www.drupal.org/core/deprecation#how-function for an example.

  2. +++ b/core/includes/unicode.inc
    @@ -10,7 +10,15 @@
    +  @trigger_error('Moves unicode_requirements() logic to system_requirements().@deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. @see https://www.drupal.org/node/2764821.', E_USER_DEPRECATED);
    

    So, there's a missing space after the period. But let's rewrite this whole paragraph to say:

    unicode_requirements() is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. There is no replacement; system_requirements() now includes the logic instead. See https://www.drupal.org/node/change-record-nid-not-issue-nid.

    Note how the wording for the @trigger_error() is slightly different, since it's a user-facing sentence rather than a docblock. You can see the format at: https://www.drupal.org/core/deprecation#how-function

  3. Also, note above that we still need a change record and that should be linked instead of this issue node. See https://www.drupal.org/contributor-tasks/draft-change-record for instructions on writing a change record.

xjm’s picture

Also, @pk188, please be sure to provide an interdiff when you make updates to a patch. Thanks!

Dinesh18’s picture

Here is an updated patch and interdiff.txt

Dinesh18’s picture

This is for the first time , I am creating the change record.
URL : https://www.drupal.org/node/2884698

Let me know, if I am missing anything.

Alka Kumari’s picture

Assigned: Alka Kumari » Unassigned
xjm’s picture

Status: Needs review » Needs work

Thanks @Dinesh18, that looks pretty good. The change record is a good start also. There is one tiny formatting error in the patch:

+++ b/core/includes/unicode.inc
@@ -10,7 +10,16 @@
+ ¶

This line is missing its asterisk.

For reviewers, note that although the interdiff from #16 includes the patch file, the patch itself is correct.

I've added a bit more detail to the change record explaining why it's deprecated, and clarifying that the function itself should simply not be used (as system_requirements() also should not be called directly).

Dinesh18’s picture

Thanks @xjm.
I will update the patch shortly.

Dinesh18’s picture

Status: Needs work » Needs review
FileSize
3.87 KB

Here is the updated patch which fix the missing asterisk.
I have reviewed the change record, it's much better than what I have wrote initially. :)
Thanks @xjm.

xjm’s picture

Status: Needs review » Reviewed & tested by the community

Alright great, I think this is ready! Thanks @Dinesh18 and @Alka Kumari.

  • catch committed 4d14b5f on 8.4.x
    Issue #2764821 by Dinesh18, Alka Kumari, pk188, xjm, catch: Inline...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.4.x, thanks!

  • xjm committed 1bf679b on 8.4.x
    Revert "Issue #2764821 by Dinesh18, Alka Kumari, pk188, xjm, catch:...
xjm’s picture

Status: Fixed » Needs work

@Calystod noticed that we linked the issue instead of the change record for this, so I've reverted the change to fix that since it was a mistake in the commit. Both @catch and I should have noticed this. :) We can just update the patch to link the CR.

clairedesbois@gmail.com’s picture

New patch with the good link to the changes record page.

clairedesbois@gmail.com’s picture

Status: Needs work » Needs review
clairedesbois@gmail.com’s picture

FileSize
644 bytes

And the interdiff between patch 21 and 27.

xjm’s picture

Status: Needs review » Reviewed & tested by the community

It looks like the original patch linked the change record in the @trigger_error() but this issue in the docblock. The updated patch fixes that.

Back to RTBC, thanks @Calystod! Good catch.

xjm’s picture

  • catch committed a93de77 on 8.4.x
    Issue #2764821 by Dinesh18, Alka Kumari, Calystod, pk188, xjm, catch:...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Oh well spotted. I always check the link because linking back to the issue is a common mistake, but only checked one link and didn't notice they were different :P

Committed/pushed to 8.4.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

scarletdrupal123’s picture

Even after setting unicode , i am not able to store french characters. Getting database exception every time.