1

I want to prevent merge conflicts caused by POST requests on the API at a later stage. Is it possible to specify a custom node id when creating new content in the Drupal user interface or database? What's the fastest, most efficient way to do this?

1

In the UI no, and you should never interact with the database directly.

But you can do this with the API easily:

$node = Node::create(['type' => 'article', 'nid' => 5]);
$node->enforceIsNew(TRUE);
$node->save();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.