Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DamienMcKenna created an issue. See original summary.

DamienMcKenna’s picture

DamienMcKenna’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
thejimbirch’s picture

Assigned: Unassigned » thejimbirch

Working on this.

thejimbirch’s picture

Attached is a patch that adds the schema_program_membership module.

The module provides the following fields:

name
programName
alternateName
hostingOrganization
member
membershipNumber
identifier
additionalType
description
disambiguatingDescription
image
mainEntityOfPage
url
sameAs

The only thing missing would be the potentialAction field which would indicate a potential Schema Action. Since there are a few actions that can be added to this and other Schemas, I created another ticket for Add support for Actions.

Please review the tests file. I am not familiar with that all, and while I believe I set it up right, I do not know how to test it.

Status: Needs review » Needs work
thejimbirch’s picture

Status: Needs work » Needs review
FileSize
25.71 KB

Updated patch attached hopefully fixing failed tests.

Status: Needs review » Needs work
thejimbirch’s picture

Assigned: thejimbirch » Unassigned

I am not sure why the tests are failing. Could someone take a look and advise?

KarenS’s picture

It's failing on "additional@type". Try removing the "@" sign from that.

thejimbirch’s picture

I guess that is why I am stuck. There is no "additional@type" in the patch. Could the tests be adding the @?

KarenS’s picture

Status: Needs work » Needs review

Ah yes, the problem is in the test. I just committed a fix to the test. Let's see if that works.

KarenS’s picture

Wah wah, now I broke the branch tests. Working on it...

KarenS’s picture

OK tests are working again and now this patch passes.

thejimbirch’s picture

Thanks so much @KarenS!

@DamienMcKenna This should be good to go as is. The only thing it is missing from the Schema.org spic is potentialAction which indicates a potential Schema.org Action. I think that could be added later, after #2942047 - Add support for Actions is added.

ChristophWeber’s picture

I agree on Actions. The base stuff needs to go in first, then we can extend ProgramMembership.
From an SEO perspective potentialAction @type SearchAction is probably the most useful type, as Google can show a site search box. https://developers.google.com/search/docs/data-types/sitelinks-searchbox

  • KarenS committed 87779f4 on 8.x-1.x authored by thejimbirch
    Issue #2937212 by thejimbirch: Add support for the ProgramMembership...
KarenS’s picture

Status: Needs review » Fixed

Committed. Thanks!

KarenS’s picture

Status: Fixed » Active

I pulled this in but am thinking about it more. How do you intend to use this? If a ProgramMembership would be the primary object on some page, it should be a module as in this patch. If the use would be to show a ProgramMembership as a property on another object, like a person or organization, ProgramMembership should be a base class and we should add the program membership property to the appropriate objects.

KarenS’s picture

Status: Active » Postponed (maintainer needs more info)
KarenS’s picture

Basically the question is would this be a top level object (i.e. a node), or only a property on another object? If the second, I need to pull this out and rework it before the next release.

ChristophWeber’s picture

Looking at http://schema.org/ProgramMembership this is a property of Organization or Person, i.e. needs to be a base class and added to the other two. Definitely not its own object.

thejimbirch’s picture

I am not DamienMcKenna, but to build this as a property makes more sense vs the way I built it in the patch above in #7.

KarenS’s picture

Status: Postponed (maintainer needs more info) » Needs review
FileSize
41.53 KB

Here's a patch to remove the module and replace it with a base class, then use the base class for a memberOf property on Person and Organization.

Status: Needs review » Needs work

The last submitted patch, 24: program-membership-2937212.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

KarenS’s picture

Status: Needs work » Needs review
FileSize
41.53 KB

Status: Needs review » Needs work

The last submitted patch, 26: program-membership-2937212.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

KarenS’s picture

Status: Needs work » Needs review
FileSize
41.53 KB
KarenS’s picture

Clean up visibility settings.

KarenS’s picture

Actually I probably shouldn't just delete the module. If someone has enabled it and it disappears they'll have problems. So I can mark it deprecated and add a hook to uninstall it. I'll leave it there for the next release. Then in the following I'll remove it. Ditto for the VotingAPI module.

KarenS’s picture

Again, with an update hook.

thejimbirch’s picture

Status: Needs review » Reviewed & tested by the community

Patch applies.
Update hooks run without error.
ProgramMembership appears as an option of memberOf in Organization

Looks good to me.

  • KarenS committed b95d4ec on 8.x-1.x
    Issue #2937212 by KarenS, thejimbirch: Add support for the...
KarenS’s picture

Status: Reviewed & tested by the community » Fixed

If someone comes back later with a good use case for top-level ProgramMembership we can revisit, but I doubt that will happen.

Status: Fixed » Closed (fixed)

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