There are several cases in Drupal 7.x and 6.x (and maybe in 8.x but I'm not sure yet -- will update this issue if so) where @defgroup items are duplicated (same group identifier being used twice). In these cases, either one of them needs to be given a different group identifier, or perhaps someone used @defgroup instead of @addtogroup.
The current 7.x version of the API module flags these, so I can tell where they are occurring at least. Here are the ones I'm seeing (and I'm running against Drupal Core code current as of a few hours ago):
6.x:
drupal-6.x/modules/comment/comment.install at line 69
drupal-6.x/modules/openid/openid.install at line 97
drupal-6.x/modules/system/system.install at line 1180
drupal-6.x/modules/system/system.install at line 2582
drupal-6.x/modules/locale/locale.install at line 17
drupal-6.x/modules/locale/locale.install at line 227
drupal-6.x/modules/statistics/statistics.install at line 120
7.x:
drupal-7.x/modules/system/system.install at line 2986
8.x doesn't have any yet (I'm half-way through parsing approximately -- I'll report back if there are errors).
For now, if someone could track down that 7.x item and figure out if it should be a separate group from the other one with the same identifier, or should be an @addtogroup instead, and make a patch, that would be great!
Reference on documentation of groups/topics:
http://drupal.org/node/1354#groups
Comment | File | Size | Author |
---|---|---|---|
#13 | fix-addtogroup-1546618-13.patch | 4.27 KB | wulff |
#10 | fix-addtogroup-1546618-10.patch | 539 bytes | wulff |
#8 | avoid-duplicate-defgroups-1546618-8.patch | 4.49 KB | wulff |
#4 | avoid-duplicate-defgroups-1546618-4.patch | 556 bytes | wulff |
Comments
Comment #1
jhodgdonThere's a patch on #1358944-10: Misused @ingroup commands that might be relevant for Drupal 7, but I am not sure it's correct. Probably one of those groups does need to be a @defgroup...
Comment #2
jhodgdonI just got this from 8.x:
drupal-8.x/modules/system/system.install at line 2986
so let's start with 8.x instead.
Comment #3
jhodgdonAnother 7.x error (could be the same as the other one I had before, but the other side of it):
drupal-7.x/includes/image.inc at line 8
That error I thought I saw on 8.x was actually from another 7.x run (I had the wrong git checkout), so I'm not currently sure there are any 8.x errors.
Comment #4
wulff CreditAttribution: wulff commentedI ran the following commands to look for duplicate defgroups in D7 and D8:
There are currently no duplicate
@defgroup
s in D8, and a single duplicate in D7:updates-7.x-extra
The
@defgroup
shows up in the following files:The attached patch changes the @defgroup in menu.install to an @addtogroup (I think makes sense to define the group in the system module).
Comment #5
wulff CreditAttribution: wulff commentedForgot to change the status...
Comment #6
jhodgdonThat patch looks good, and I appreciate the thorough analysis! That image.inc error I saw before must have been some kind of artifact, because it is not actually a duplicate defgroup. So, I'll get this committed shortly.
Comment #7
jhodgdonCommitted to 7.x. I think we need a similar patch for 6.x, but I would hesitate to call it a "port", since the list of duplicates is not the same there.
Comment #8
wulff CreditAttribution: wulff commentedDrupal 6 contains two duplicate
@defgroup
swhich appear in the following files
This patch keeps the
@defgroup
insystem.install
and changes the other occurences to@addtogroup
.Comment #9
jhodgdonI didn't notice this in the 7.x patch, but when you use addtogroup, you should only have the machine name of the group. We'd better go back and fix the 7.x patch.
Which is to say, you want just
@addtogroup updates-7.x-extra
not
@addtogroup updates-7.x-extra Extra updates for 7.x
Comment #10
wulff CreditAttribution: wulff commentedI have attached a patch which fixes the problem in 7.x. I'll modify the 6.x patch as well.
Comment #11
jhodgdonThanks! I'll get that 7.x patch committed shortly.
Comment #12
jhodgdonCommitted fix to 7.x. Back to 6.x, where the patch in #8 needs a bit of adjusting, see #9.
Comment #13
wulff CreditAttribution: wulff commentedUpdated the patch from #8 to match the documentation standards.
Comment #14
jhodgdonThanks! Looks fine this time.
Comment #15
jhodgdonI now can commit docs patches to d6, so this is finally in! Thanks wulff!