2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
$error["path"]=theme("theme_error",t("The path is invalid."));
$node->path=trim($node->path);
if($node->path&&!valid_url($node->path)){
$error["path"]=t("The path is invalid.");
return$error;
}
elseif(db_result(db_query("SELECT COUNT(dst) FROM {path} WHERE dst = '%s' AND src != '%s'",$_POST["edit"]["path"],"node/view/$node->nid"))){
$error["path"]=theme("theme_error",t("The path is already in use."));
elseif(db_result(db_query("SELECT COUNT(dst) FROM {path} WHERE dst = '%s' AND src != '%s'",$node->path,"node/view/$node->nid"))){
$error["path"]=t("The path is already in use.");
return$error;
}
$edit["path"]=$_POST["edit"]["path"];
}
break;
case"form pre":
returnform_textfield(t("Path alias"),"path",$edit["path"],60,250,$error["path"]?$error["path"]:t("Optionally specify an alternative URL by which this node can be accessed. For example, type 'about' when writing an about page. Use a relative path and don't add a trailing slash or the URL alias won't work."));
break;
returnform_textfield(t("Path alias"),"path",$node->path,60,250,t("Optionally specify an alternative URL by which this node can be accessed. For example, type 'about' when writing an about page. Use a relative path and don't add a trailing slash or the URL alias won't work.").theme_error($arg["path"]));
$error["path"]=theme("theme_error",t("The path is invalid."));
$node->path=trim($node->path);
if($node->path&&!valid_url($node->path)){
$error["path"]=t("The path is invalid.");
return$error;
}
elseif(db_result(db_query("SELECT COUNT(dst) FROM {path} WHERE dst = '%s' AND src != '%s'",$_POST["edit"]["path"],"node/view/$node->nid"))){
$error["path"]=theme("theme_error",t("The path is already in use."));
elseif(db_result(db_query("SELECT COUNT(dst) FROM {path} WHERE dst = '%s' AND src != '%s'",$node->path,"node/view/$node->nid"))){
$error["path"]=t("The path is already in use.");
return$error;
}
$edit["path"]=$_POST["edit"]["path"];
}
break;
case"form pre":
returnform_textfield(t("Path alias"),"path",$edit["path"],60,250,$error["path"]?$error["path"]:t("Optionally specify an alternative URL by which this node can be accessed. For example, type 'about' when writing an about page. Use a relative path and don't add a trailing slash or the URL alias won't work."));
break;
returnform_textfield(t("Path alias"),"path",$node->path,60,250,t("Optionally specify an alternative URL by which this node can be accessed. For example, type 'about' when writing an about page. Use a relative path and don't add a trailing slash or the URL alias won't work.").theme_error($arg["path"]));