You can find attached a views hook for the copyright module (remove the txt extension).
In order to get it to work, add the following lines to the copyright module:

if (module_exists('views')) {
  include(drupal_get_path('module', 'copyright') .'/views_copyright.inc');
}

If this would make any changes to be committed, let me know so I can create a new patch.

Comments

Robrecht Jacques’s picture

Is this for 5.x or 4.7.x or both. Currently there is no HEAD version.

I will add it to the copyright module. I see no need to create a seperate include file for this - I'll add the code to the copyright.module itself.

So, let me know what version(s), and I'll add it.

toemaz’s picture

Hi Robrecht,

I'm running the views for 5.1, but I guess it will run for 4.7 as well, althought I didn't test this yet.
I will finetune the code some more and then create a patch against the latest CVS version.

Robrecht Jacques’s picture

Version: master » 5.x-1.x-dev

I've added it (without testing) to the 5.x-1.x-dev branch. Please test and report back. If tested I'll release a 5.x-1.1 release with this included (and then maybe backport to 4.7.x).

Keeping the issue "active". Post your "finetuning" here. Or let me know that it works.

Thanks!

Robrecht Jacques’s picture

Status: Active » Needs review
toemaz’s picture

StatusFileSize
new2.49 KB

Thx for comitting ;-) As promissed, I would finetune the code a bit more and so I did.

  • A few tweaks on the views hook: adding a handler and changing some help text.
  • I enhanced the copyright_get_license_names() function so the licenses are being cached during the views build. This would have otherwise consumed one query for each row extra.

I would like to have at least one user who can test this code. If you made a views so far, make sure you delete the cache (using the devel module is the best way) and resubmit the views again.

I don't see much further improvements, at least, not for what I need.

Thx

Robrecht Jacques’s picture

Thanks again! Committed to 5.x-1.x-dev.

Time permitted, I'll try to test it a bit more next week. If it works I'll close this issue (or maybe set it as "patch (to be ported)" to 4.7.x).

If someone else wants to test and give feedback, please do!

Robrecht Jacques’s picture

Status: Needs review » Fixed

Fixed in 5.x-1.x-dev. Will be included in the next release of the copyright module (5.x-1.1). Thanks!

Robrecht Jacques’s picture

Status: Fixed » Closed (fixed)