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

Files: 
CommentFileSizeAuthor
#13 fix-addtogroup-1546618-13.patch4.27 KBwulff
PASSED: [[SimpleTest]]: [MySQL] 190 pass(es).
[ View ]
#10 fix-addtogroup-1546618-10.patch539 byteswulff
PASSED: [[SimpleTest]]: [MySQL] 39,096 pass(es).
[ View ]
#8 avoid-duplicate-defgroups-1546618-8.patch4.49 KBwulff
PASSED: [[SimpleTest]]: [MySQL] 190 pass(es).
[ View ]
#4 avoid-duplicate-defgroups-1546618-4.patch556 byteswulff
PASSED: [[SimpleTest]]: [MySQL] 39,044 pass(es).
[ View ]

Comments

There'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...

Version:7.x-dev» 8.x-dev
Issue tags:+needs backport to D7

I just got this from 8.x:
drupal-8.x/modules/system/system.install at line 2986
so let's start with 8.x instead.

Version:8.x-dev» 7.x-dev

Another 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.

StatusFileSize
new556 bytes
PASSED: [[SimpleTest]]: [MySQL] 39,044 pass(es).
[ View ]

I ran the following commands to look for duplicate defgroups in D7 and D8:

$ grep -rin "@defgroup" * | perl -pe 's|^.*defgroup\s(.*?)\s.*$|$1|' | sort | uniq -d

There are currently no duplicate @defgroups in D8, and a single duplicate in D7: updates-7.x-extra

The @defgroup shows up in the following files:

$ grep -rin "@defgroup updates-7.x-extra" *
modules/menu/menu.install:73: * @defgroup updates-7.x-extra Extra updates for 7.x
modules/system/system.install:2991: * @defgroup updates-7.x-extra Extra system updates for 7.x

The attached patch changes the @defgroup in menu.install to an @addtogroup (I think makes sense to define the group in the system module).

Status:Active» Needs review

Forgot to change the status...

Status:Needs review» Reviewed & tested by the community

That 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.

Version:7.x-dev» 6.x-dev
Status:Reviewed & tested by the community» Active

Committed 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.

Status:Active» Needs review
StatusFileSize
new4.49 KB
PASSED: [[SimpleTest]]: [MySQL] 190 pass(es).
[ View ]

Drupal 6 contains two duplicate @defgroups

updates-5.x-to-6.x
updates-6.x-extra

which appear in the following files

modules/blogapi/blogapi.install:61: * @defgroup updates-5.x-to-6.x Blog API updates from 5.x to 6.x
modules/locale/locale.install:18: * @defgroup updates-5.x-to-6.x Locale updates from 5.x to 6.x
modules/system/system.install:1181: * @defgroup updates-5.x-to-6.x System updates from 5.x to 6.x
modules/comment/comment.install:70: * @defgroup updates-6.x-extra Extra system updates for 6.x
modules/dblog/dblog.install:103: * @defgroup updates-6.x-extra Extra database logging updates for 6.x
modules/locale/locale.install:228: * @defgroup updates-6.x-extra Locale updates for 6.x
modules/openid/openid.install:98: * @defgroup updates-6.x-extra Extra openid updates for 6.x
modules/statistics/statistics.install:121: * @defgroup updates-6.x-extra Extra statistics updates for 6.x
modules/system/system.install:2583: * @defgroup updates-6.x-extra Extra system updates for 6.x

This patch keeps the @defgroup in system.install and changes the other occurences to @addtogroup.

Version:6.x-dev» 7.x-dev
Status:Needs review» Needs work

I 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

Status:Needs work» Needs review
StatusFileSize
new539 bytes
PASSED: [[SimpleTest]]: [MySQL] 39,096 pass(es).
[ View ]

I have attached a patch which fixes the problem in 7.x. I'll modify the 6.x patch as well.

Status:Needs review» Reviewed & tested by the community

Thanks! I'll get that 7.x patch committed shortly.

Version:7.x-dev» 6.x-dev
Status:Reviewed & tested by the community» Needs work

Committed fix to 7.x. Back to 6.x, where the patch in #8 needs a bit of adjusting, see #9.

Status:Needs work» Needs review
StatusFileSize
new4.27 KB
PASSED: [[SimpleTest]]: [MySQL] 190 pass(es).
[ View ]

Updated the patch from #8 to match the documentation standards.

Status:Needs review» Reviewed & tested by the community

Thanks! Looks fine this time.

Status:Reviewed & tested by the community» Fixed

I now can commit docs patches to d6, so this is finally in! Thanks wulff!

Automatically closed -- issue fixed for 2 weeks with no activity.