Problem/Motivation

We previously used a text field with rudimentary validation for phone numbers for the user entity, then we installed this module and migrated the existing data using an SQL query. The policy is that each user has to correct their own phone number when updating their own account.

But sometimes we have to update user entities in bulk, either through the UI or programmatically, and for large numbers of users this pollutes watchdog with number format errors, pushing useful watchdog messages out. This is also annoying when running drush commands and the console fills up with these errors.

We've been using a custom patch that just removes the error logging, but a decision would have to be made by maintainers whether to remove it completely, or disable it based on a setting, or replace the watchdog logging with status messages (which would just spam the UI instead of watchdog so this wouldn't really be an improvement), etc. I guess a check could be made if the field belongs to an entity that is an instance of UserInterface and the current user has the same ID and only log an error in that case, but there could also be a considerable amount of use cases where the field belongs to a entity that is an instance of ProfileInterface and checking that would introduce undesired dependency complications.

Proposed resolution

The watchdog errors seem unnecessary to me regardless of use case, so I suggest removing them completely.

Comments

ts.ag created an issue. See original summary.

ts.ag’s picture

For those who wish to disable the logging of these errors, I'm attaching patch files to use in Composer with 3.x and 4.x.

  • saidatom committed 862a39e6 on 4.0.x
    feat: #3561635 Add configurable logging for phone number parse errors.
    
saidatom’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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