l10n_update_update_7207() throws a warning when there are no plural source strings because l10n_update_get_d8_plural_strings() returns FALSE and count() expects an array.

I'm wondering if there is also a problem with the query, because my database should not return no results.

Comments

douggreen created an issue. See original summary.

douggreen’s picture

Status: Active » Needs review
StatusFileSize
new800 bytes

patch attached

gábor hojtsy’s picture

Hm, interesting find. Does that match the expectation of the API elsewhere though?

pfrenssen’s picture

Status: Needs review » Reviewed & tested by the community

Answering #3: the function is called twice: in l10n_update_d8_plural_conversion() and l10n_update_update_7207(). Both uses are compatible with the new function return value. None of them were checking explicitly for a FALSE value.

I don't think there is a problem with the query. In my site the locales_source table contained 13k rows, but apparently none with a L10N_UPDATE_PLURAL_DELIMITER. I used the following query to check:

MariaDB> select * from locales_source where source like concat('%', char(3), '%');
Empty set (0.010 sec)

Patch fixes the problem and updates documentation to match the new API. Looking good to me.

  • Sutharsan committed 49a7468 on 7.x-2.x authored by douggreen
    Issue #3232972 by douggreen: l10n_update_update_7207() throws warning
    
sutharsan’s picture

Status: Reviewed & tested by the community » Fixed

I agree that there is no harm in changing the return value signature for the current usage. Although their is no BC policy for Drupal 7, I consulted the D8/9 policy, and as the function is defined in an .install file, it should be consider as internal.

Thanks to all. Patch is now committed, new release to follow.

Status: Fixed » Closed (fixed)

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