Make WordPress Core

Opened 12 years ago

Last modified 3 years ago

#11023 new defect (bug)

Gallery Category Doesn't change with article

Reported by: mrgtb Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Gallery Keywords: has-patch needs-testing dev-feedback
Focuses: Cc:


Lets say I have a default category setup called Drafts that all articles go into at first by default. Then on completing the article before posting it live, I movie it to another category called News (no longer having the draft category ticked also). If I've added an image with that article that I click to view a bigger picture of in the gallery page (image.php). It still shows it as being listed under the Drafts category, while the article itself is listed under just News category.

Attachments (1)

11023.diff (762 bytes) - added by oso96_2000 8 years ago.

Download all attachments as: .zip

Change History (9)

#1 @dd32
12 years ago

I believe this might be because uploads will ALWAYS recieve the default category, And never inherit the parents categories unless a plugin is used.. Just as you cant assign categories to uploads directly.

I do however agree, If an attachment is attached to a post, and %category% is used within the permalink, it should be that of the parent.

#2 @scribu
12 years ago

  • Milestone changed from Unassigned to 2.9

#3 @mrgtb
12 years ago

I see your point, Drafts is a parent category. While News is a Sub Category of Articles (Articles/News). So it looks like because I moved the articles from a default Top Category called Drafts to a sub category called Articles/News. This is why it's not updated.

OK, I'll, move the article to be included in both Articles/News or just Articles and see the difference

#4 @janeforshort
12 years ago

  • Milestone changed from 2.9 to Future Release

Punting, no patch.

This ticket was mentioned in IRC in #wordpress-dev by oso96_2000. View the logs.

8 years ago

8 years ago

#6 @oso96_2000
8 years ago

  • Keywords has-patch needs-testing added

Not sure if this would be the correct answer. In my tests I couldn't find that removing that condition causes problems and what it does is redirect the attachment page to the new one when a category is changed. If the attachment isn't attached to a post, it still uses the ?attachment_id=# page.

Of course, this only redirects, if the image is linked inside a post it still uses the old url.

#7 @oso96_2000
8 years ago

  • Keywords 2nd-opinion added

#8 @chriscct7
6 years ago

  • Keywords dev-feedback added; Gallery Category 2nd-opinion removed
Note: See TracTickets for help on using tickets.