Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 303278

MachineName migrate process plugin should make allowed characters regular expression configurable

$
0
0

Problem/Motivation

The machine_name migrate process plugins replaces all non alphanumeric characters with underscores. It would be great if that would be a bit more flexible. Concretely, for some machine names it makes sense to allow a period as part of the name which currently gets replaced.

The code that currently handles this is the following:

    $new_value = preg_replace('/[^a-z0-9_]+/', '_', $new_value);

Proposed resolution

Add some configuration value to the plugin for this. Not sure whether the whole regular expression, i.e. [^a-z0-9]+ should be configurable or just the character range, i.e. a-z0-9_.


Viewing all articles
Browse latest Browse all 303278


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>