I've decided to give developers possibility to add own reports to Summary Report page.
It should look like a hook that allows to add meta information for new report and assign callback function for the report generating.

Comments

Konstantin Komelin’s picture

Status: Active » Needs work
Konstantin Komelin’s picture

Done for 6.x-2.x-dev.
Commit: http://drupalcode.org/project/yandex_metrics.git/commit/2a6b354

It is required to write documentation.

kalabro’s picture

Status: Needs work » Needs review
StatusFileSize
new12.16 KB

Port to 7.x-2.x.
The same as #2, but without Drupal.parseJson

Konstantin Komelin’s picture

Excellent job, kalabro! Thank you!

Commited it: http://drupalcode.org/project/yandex_metrics.git/commit/0e6422a

Konstantin Komelin’s picture

Status: Needs review » Reviewed & tested by the community

I've tested the API.

Konstantin Komelin’s picture

Status: Reviewed & tested by the community » Needs work

It's necessary to write documentation about API.

kalabro’s picture

Status: Needs work » Needs review
StatusFileSize
new1.26 KB

When I started to write API.txt I found that we don't use classic drupal cache + alter.
I think we can add it now.

Konstantin Komelin’s picture

Looks promising! As I mentioned before, it'd be important improvement.
I'll review it ASAP.
Thanks, Kate!

Konstantin Komelin’s picture

I applied #7 patch and caught several warnings:

    Warning: array_merge() [function.array-merge]: Argument #1 is not an array in yandex_metrics_reports_get_list() (line 1133 of H:\vhosts\drupal7\sites\all\modules\yandex_metrics\yandex_metrics_reports\yandex_metrics_reports.module).
    Warning: Invalid argument supplied for foreach() in yandex_metrics_reports_get_active_list() (line 1150 of H:\vhosts\drupal7\sites\all\modules\yandex_metrics\yandex_metrics_reports\yandex_metrics_reports.module).
    Warning: array_keys() expects parameter 1 to be array, null given in yandex_metrics_reports_report() (line 322 of H:\vhosts\drupal7\sites\all\modules\yandex_metrics\yandex_metrics_reports\yandex_metrics_reports.module).
    Warning: Invalid argument supplied for foreach() in yandex_metrics_reports_report() (line 330 of H:\vhosts\drupal7\sites\all\modules\yandex_metrics\yandex_metrics_reports\yandex_metrics_reports.module).

Messages say a lot about issue.

Konstantin Komelin’s picture

Status: Needs review » Needs work
kalabro’s picture

Status: Needs work » Needs review
StatusFileSize
new1.41 KB

Thanks for reviews! I hope I fixed it:

kalabro’s picture

StatusFileSize
new1.99 KB

Added permanent cache via cache_set.

Konstantin Komelin’s picture

Status: Needs review » Reviewed & tested by the community

Sorry for the delay.
#12 looks great!
Kate, could you commit it?

I am going to port it to 6.x-2.x.

Konstantin Komelin’s picture

Caching ported to 6.x-2.x.
Commit: http://drupalcode.org/project/yandex_metrics.git/commit/17431ff

Kate, I can help with commit for 7.x. Just let me know.

kalabro’s picture

Status: Reviewed & tested by the community » Fixed

Commited (without changelog record duplication).
Thanks!

http://drupalcode.org/project/yandex_metrics.git/commit/cb37cd624afcd0bf...

Konstantin Komelin’s picture

Good job, Kate!

JFYI:
It's necessary to mention commit author(s) in commit message.
For example: by kalabro: Added caching of reports list.
And issue number is not compulsory.

kalabro’s picture

Oops, my mistake! Thanks for note.

Konstantin Komelin’s picture

Status: Fixed » Closed (fixed)