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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhodgdon’s picture

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

jhodgdon’s picture

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.

jhodgdon’s picture

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.

wulff’s picture

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

wulff’s picture

Status: Active » Needs review

Forgot to change the status...

jhodgdon’s picture

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.

jhodgdon’s picture

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.

wulff’s picture

Status: Active » Needs review
FileSize
4.49 KB

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.

jhodgdon’s picture

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

wulff’s picture

Status: Needs work » Needs review
FileSize
539 bytes

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

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

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

jhodgdon’s picture

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.

wulff’s picture

Status: Needs work » Needs review
FileSize
4.27 KB

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

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Thanks! Looks fine this time.

jhodgdon’s picture

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.