Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Problem/Motivation
The documentation code has incorrect PHP syntax, and is a bit messed up
Proposed resolution
Fix it
Remaining tasks
Do it
User interface changes
None
API changes
None
Data model changes
None
Beta phase evaluation
Issue category | Task because documentation updated needs to be done |
---|---|
Issue priority | Normal |
Unfrozen changes | Unfrozen because it only changes documentation |
Comment | File | Size | Author |
---|---|---|---|
#9 | interdiff.txt | 1.3 KB | googletorp |
#9 | code_example_for_non-2547933-9.patch | 1.32 KB | googletorp |
#2 | code_example_for_non-2547933-2.patch | 794 bytes | googletorp |
Comments
Comment #2
googletorp CreditAttribution: googletorp commentedThe code probably used to say entity_create(...
Anyways this fixes the example code.
Comment #3
googletorp CreditAttribution: googletorp commentedUpdated beta evaluation.
Comment #4
jhodgdonCan we possibly fix up the rest of this doc block too? See
https://api.drupal.org/api/drupal/core!includes!entity.inc/function/enti...
In the Deprecated secition, it says "....If the display is available in configuration use:" and then it ends abruptly, so something is wrong there.
Also, why are we giving examples on a deprecated function anyway? We should just say it's deprecated and say what to use instead.
Comment #5
googletorp CreditAttribution: googletorp commented#4 It seems like API site is broken or we need to fix all depricated docs. We do this a lot of places:
* @deprecated as of Drupal 8.0.x, will be removed before Drupal 9.0.0.
* If the entity form display is available in configuration use:
* @code
* \Drupal::entityManager()->getStorage('entity_form_display')->load($entity_type . '.' . $bundle . '.' . $form_mode);
* @endcode
But API just kills everything after the initial @code. I'm not expert in doxygen, but my guess is that the documentation is fine a tweak is needed to pull out code samples inside a @deprecated tag.
Comment #6
googletorp CreditAttribution: googletorp commentedNote if this is a mistake in the documentation syntax, we should probably make a seperate task for it, as all documentation use this structure which apparently doesn't work well on the API site.
Comment #7
jhodgdonAh. Sorry, I didn't look at the file... If there is no blank line inside the @deprecated, that seems like an API module bug. Filed:
#2549525: Code samples and/or multi-line not working in @deprecated
So let's just fix up the examples then...
Comment #8
jhodgdonOh, it could be the indentation. Normally inside @param, @return, @deprecated, etc. everything (including @code tags) should be indented by 2 spaces. This isn't, so probably the API module is reading it as "OK, indentation went back to 0, that's it for @deprecated".
Comment #9
googletorp CreditAttribution: googletorp commentedI fixed indentation of @code tags under @deprecate tags.
Comment #10
jhodgdonThat looks good, thanks!
Comment #12
webchickCommitted and pushed to 8.0.x. Thanks!