WordPress / WordPress/phpdoc-parser

Handling duplicate entries with the same parent ID

Open
#43 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
PHP
Stars
239
Forks
81
Avg merge
16h 29m
Merged PRs (30d)
8

Description

When the same hook is called twice within the same function, the check for an existing ID will come up as true, even though the meta (e.g. line-number) will likely be different for the second call as the first call. Equally, if functions with the same name are defined twice, perhaps in the global namespace (parent ID = 0) in different files that are not included within the same request, they too will have different meta data and should be different entries.

Perhaps a join to postmeta table on the existing ID check and also compare the file and / or line number would narrow it down?

If the same hook is being called twice on the same line in the same file, well, that's just stupid! (But technically plausible.)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the existing ID check for repeated hook calls and inspect how entries are matched against the postmeta table. Verify the behavior for repeated calls with different file or line metadata, and for same-named functions in separate files. Done means distinct metadata produces distinct entries while identical calls remain handled consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
database, documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.