When creating a new profile from an existing one, fix also the usage of
the submit callbacks, not only the functions names.
cp "${original_file}" "$DESTINATION_FILE"
if file "$original_file" | grep -q PHP;
then
cp "${original_file}" "$DESTINATION_FILE"
if file "$original_file" | grep -q PHP;
then
- sed -i "s/^function ${CURRENT_PROFILE}_/function ${PROFILE_MACHINE_NAME}_/g" "$DESTINATION_FILE"
+ sed -i \
+ -e "s/^function ${CURRENT_PROFILE}_/function ${PROFILE_MACHINE_NAME}_/g" \
+ -e "s/\$form\['#submit'\]\[\] = '${CURRENT_PROFILE}_/\$form\['#submit'\]\[\] = '${PROFILE_MACHINE_NAME}_/g" \
+ "$DESTINATION_FILE"