Modify available licenses

Forums: 

Hi All,

I'm attempting to modify the available licenses when authors are creating h5p. Specifically, I'm attempt to remove CC BY 2.0 as an option.

However, any attempts to make these modifications in h5p.classes.php or h5p.js (Drupal 9.x-2.0.0) seem to be ignored. I imagine I'm missing something?

Thanks in advance for any insight,

Yasin

 

Content types: 
otacke's picture

Hi Yasin!

Patching H5P core is something that's to be done at your own risk, but I think the relevant places should be:

  • Make 2.0 values invalid for content (will impact existing content!):  https://github.com/h5p/h5p-php-library/blob/d3d003e978ae361bcc5d2f0f36bb349923e61636/h5p.classes.php#L706
  • Remove translation: https://github.com/h5p/h5p-php-library/blob/d3d003e978ae361bcc5d2f0f36bb349923e61636/h5p.classes.php#L3620
  • Remove option from metadata fields: https://github.com/h5p/h5p-php-library/blob/d3d003e978ae361bcc5d2f0f36bb349923e61636/h5p.classes.php#L5111-L5114
  • Remove option from old copyright fields: https://github.com/h5p/h5p-php-library/blob/d3d003e978ae361bcc5d2f0f36bb349923e61636/h5p.classes.php#L5357-L5360
  • Remove field option/translation from field values https://github.com/h5p/h5p-php-library/blob/22115c0aeaa34faef5109c3f378add2d1647c837/js/h5p.js#L2739

Hope that's all, but that's all I could find by browsing github on my smartphone :-)

Best,

Oliver 

Thanks Oliver - yes, it was a simple oversight on my part - there are two $semantics in h5p.classes.php, I didn't see the first second one in getCopyrightSemantics().

"Patching H5P core is something that's to be done at your own risk"

I 100% agree - the client needed to see this for themselves and have decided against running their own licenses.

However, I will submit a PR as I believe CC 2.0 is problematic enough to be considered for removal, read more here: https://doctorow.medium.com/a-bug-in-early-creative-commons-licenses-has...

That said, I know that it is not as simple as removing the 2.0 as an option and some helper functions to convert will be necessary, if this was to be acted upon.

Thanks again for the help.

Yasin

otacke's picture

Hi!

Yup, I know. That was a major reason why 3.0 was released. I am not sure though if prohibiting to use the 2.0 versions in general is the right approach. Might be smarter to make the licenses configurable in the integrations that pass their wishes to H5P core. One would need to think that through for validation of content, however.

Cheers,
Oliver

"Might be smarter to make the licenses configurable in the integrations that pass their wishes to H5P core."

This would be great. I think separating licenses out to as a service that includes all/any license added by the community (moderated of course), with the core being configurable in the implementation (e.g. some checkboxes) might be a good approach. Would be easy for non-tech folks to make suggestions for licenses.

A lot of work would be needed for this, however.