Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
API page: http://api.drupal.org/api/drupal/developer!topics!forms_api_reference.ht...
Is:
// Save.
file_save($file);
// Record that the module (in this example, user module) is using the file.
file_usage_add($file, 'user', 'user', $account->uid);
Does not work for me now. Warnings about files not referenced.
Should be:
// Record that the module (in this example, user module) is using the file.
file_usage_add($file, 'user', 'user', $account->uid);
// Save.
file_save($file);
That way works all right.
Comments
Comment #1
jhodgdonThanks! Moving to the project that contains the Form API reference file.
Comment #2
Mołot CreditAttribution: Mołot commentedI created this issue using link at the bottom of documentation page. Project was auto-selected (as well as documentation category) If these links are broken, maybe you should contact the website maintenance team? Unless core is a special case, that is.
Comment #3
jhodgdonI am on the website maintenance team. :) We're aware of the issue. There are just a few pages where the link would need to be fixed and we haven't gotten around to fixing it yet, so I just move those few issues manually.
Comment #4
Mołot CreditAttribution: Mołot commentedOh OK, thank you. Glad it was not a mistake on my side. I'll try to watch out reporting on core's documentation next time.