WordPress.org

Making WordPress.org

Opened 4 months ago

Last modified 4 months ago

#4675 new defect

Profile activity: WordCamp year shown twice

Reported by: casiepa Owned by:
Milestone: Priority: normal
Component: WordCamp Site & Plugins Keywords:
Cc:

Description

As per picture, there is no need to add the WordCamp year if it is already present in the name.

Attachments (1)

Capture.PNG (20.2 KB) - added by casiepa 4 months ago.

Download all attachments as: .zip

Change History (2)

@casiepa
4 months ago

#1 @coffee2code
4 months ago

  • Component changed from Profiles to WordCamp Site & Plugins

I believe this falls on the WordCamp side of things and may've just been a temporary situation based on WordCamp naming that has since been corrected (though that wouldn't "fix" the activity entries that had already been created).

The activity log strings for WordCamp speakers (as cited in ticket's screenshot) is constructed within the Profiles activity handler. It directly uses the wordcamp_name value as sent in the data payload from WordCamp.org. Which means "WordCamp Moscow 2018 2018" was what was sent to Profiles.

WordCamp sends as the wordcamp_name payload the return value of get_wordcamp_name(). That function does append a year to the WordCamp name provided in the corresponding post.

The function description says:

The results of bloginfo( 'name' ) don't always contain the year, but the title of the site's
corresponding `wordcamp` post is usually named 'WordCamp [Location]', so we can get
a consistent name most of the time by using that and adding the year (if available).

The code does not check to see if the post title already contains a year, so the convention probably is to not include the year there. WordCamp Moscow 2018 probably put the year in there. As speakers were confirmed, get_wordcamp_name() tacked on the year, resulting in "WordCamp Moscow 2018 2018". The activity entries would require a manual update of database fields to remove the duplicate year since they are stored as strings.

On the WordCamp side of things, get_wordcamp_name() should probably account for the possibility of a year in the post title and not append one if already present.

Note: See TracTickets for help on using tickets.