Hi there,

are there any plans for a Drupal 7 release / upgrade / version of tagadelic.module?
Just wondering, not even a patch yet.
Anyone tried to upgrade yet?
What about HEAD revision?

cheers,

daniel

Comments

flecus’s picture

subscribe

frank ralf’s picture

Drupal 7 version is already in the making (HEAD), see http://drupalcode.org/viewvc/drupal/contributions/modules/tagadelic/?pat...

tanoshimi’s picture

Although the Drupal 7.x branch has been created, it doesn't look like any development has happened there yet.
Still - it should be an easy port - the tagadelic module is small and quite neat. I might have a look at it myself tomorrow.

frank ralf’s picture

For all who want to give it a try: Converting 6.x modules to 7.x, and Coder module is already available for Drupal 7 ;-)

tanoshimi’s picture

The biggest challenge is that taxonomy is handled in a completely different in D7 than in D6 - taxonomy terms are now fields attached to nodes rather than relationships stored in term_node_data. So, all the tagadelic queries will have to be rewritten, and functions such taxonomy_node_get_terms() don't exist any more.

Bèr Kessels’s picture

development happens on github. Keeping CVS to a bare minimum.
Feel free to join there and push patches.

frank ralf’s picture

tanoshimi’s picture

For those of us that don't do git, can you confirm that the version linked in the last post is the same as HEAD in CVS?

tanoshimi’s picture

Assigned: Unassigned » tanoshimi
Status: Active » Needs review
StatusFileSize
new17.42 KB

Attached patch converts current tagadelic HEAD to Drupal 7. I've given it a quick test against D7-alpha3 and I think it's safe and feature-complete, but it would be helpful if people could download and try to test it more thoroughly - almost all of the queries had to be completely rewritten, together with changes to the theme functions etc. mean there's quite a lot of scope for error!

tanoshimi’s picture

StatusFileSize
new29.46 KB

And, for those who don't/catch apply patches, here's the same file in .zip format. Please test away...

frank ralf’s picture

Wow, that looks great on first glance. (I'm not sure the .project file that crept in really belongs.)

danielnolde’s picture

After adding and viewing a tagadelic-block using above tagadelic D7 version from comment #10, i got this error message:


Fatal error: Call to a member function join() on a non-object in ..../sites/all/modules/tagadelic/tagadelic.module on line 251

Anyone else got that error?
Looking into the code i found that this fragment at line 248 in tagadelic.module using the db abstraction layer's chaining-feature is causing the error:

    $query = db_select('taxonomy_term_data', 'td')
      ->fields('td', array('tid', 'vid', 'name', 'description'))
      ->join('taxonomy_index', 'ti', 'td.tid = ti.tid')
      ->join('node', 'n', 'ti.nid = n.nid')
      ->condition('td.vid', $vids, 'IN')
      ->groupBy('td.tid')
      ->groupBy('td.vid')
      ->groupBy('td.name')
      ->groupBy('td.description')
      ->addExpression('COUNT(*)', 'count')
      ->orderBy('count', 'DESC')
      ->range(0, $size);
    $result = $query->execute();

After investigating and trying to bugfix, i found out at http://drupal.org/node/310075, that "The return value of a join method is the alias of the table that was assigned." - join-methods don't return the query-object and can't be chained further (as well as some other db abstraction layer methods).
The problem is solved by replacing the above fragment at line 248 in tagadelic.module with this unchained version:

    $query = db_select('taxonomy_term_data', 'td');
    $query->fields('td', array('tid', 'vid', 'name', 'description'));
    $query->join('taxonomy_index', 'ti', 'td.tid = ti.tid');
    $query->join('node', 'n', 'ti.nid = n.nid');
    $query->condition('td.vid', $vids, 'IN');
    $query->groupBy('td.tid');
    $query->groupBy('td.vid');
    $query->groupBy('td.name');
    $query->groupBy('td.description');
    $query->addExpression('COUNT(*)', 'count');
    $query->orderBy('count', 'DESC');
    $query->range(0, $size);
    $result = $query->execute();     

Please test and confirm.

Bèr Kessels’s picture

I am travelling for some time, so will not be able to look at this thoroughly. Some things that need reviewing:
* code style. Is it implemented clean enough, does it not introduce new clutter, hacks or uglyness. Current code is far fromperect, lets not make it worse.
* benchmark. Tagadelic has performance issues, if not done well. Lets not make things worse: run trough AB to see the numbers.
* Test on large tagsets.
* Test on old sites. e.g upgraded from back in the 4.x days.
* Test on sites with access systems. Tagadelic does not work well with these, now, lets not make things worse.

tanoshimi’s picture

#12 - @DanielNolde is correct. I always forget which DBTNG methods can be chained and which can't!

I'm not sure if chaining methods where possible makes any difference to performance, but I can confirm that your solution of not chaining at all fixes the problem.

Bèr Kessels’s picture

in add to #12 and #14: I am a fan of chaining, provided the language supports it properly. IMHO PHP does not.
So lets steer away from it. And go for the simpler (yet more verbose) route in #14.

R.Muilwijk’s picture

StatusFileSize
new16.28 KB

Attached a new version with the code style fixed and the DBTNG fatal error fixed.

dinknaround’s picture

Admit: I don't know how to create a patch! But, here is a quick fix for tagadelic_page_list(), which calls theme_tagadelic_list_box($variables), which calls theme('box', $vocabulary->name, $content)...which is obsolete in d7.

/**
 * Menu callback renders a tagadelic page with listed items: each voc
 */
function tagadelic_page_list($vocs) {

  if (!$vocs) {
    return drupal_not_found();
  }

  $tags = tagadelic_get_weighted_tags($vocs, variable_get('tagadelic_levels', 6), variable_get('tagadelic_page_amount', '60'));
  $tags = tagadelic_sort_tags($tags);

  $output = theme('tagadelic_weighted', array('terms' => $tags));

  if (!$output) {
    return drupal_not_found();
  }
  
  $vocabularies = taxonomy_vocabulary_load_multiple($vocs);
  foreach ($vocabularies as $vocabulary) {
    $names[] = $vocabulary->name;
  }
  $vocab_names = implode(', ', $names);

  $stylesheet = drupal_get_path('module', 'tagadelic') . '/tagadelic.css';
  drupal_add_css($stylesheet, 'all');
  drupal_set_title($vocab_names);
  
  $output = "<div class=\"wrapper tagadelic\">$output</div>";
  return $output;
}
frank ralf’s picture

Thanks for the code! You might have a look at http://drupal.org/patch

AlanAtLarge’s picture

subscribe

sylv3st3r’s picture

Hi all,

First of all, I forgot to return here after I ported this module to D7. Currently it's working on my alpha6 site, a almost released site. Then when I thought to return my quick ported module. There already this thread.
The problem is, I don't have much time to look what we already have here. So should I attach my ported version here? For the community to review? I think I got everything working fine on mine.

Bèr Kessels’s picture

pcambra’s picture

suscribe

dasjo’s picture

using http://github.com/mscharley/tagadelic/tree/DRUPAL-7--1
tag clouds work fine.

when going to a term page (taxonomy/term/id) i get WSOD with the following error:
[Tue Nov 23 12:21:51 2010] [error] [client ::1] PHP Fatal error: [] operator not supported for strings in /mysite/includes/common.inc on line 2266, referer: http://mysite/

yojana78482’s picture

Status: Needs review » Fixed

#21 works fine for me for creating the tag cloud in blocks

Status: Fixed » Closed (fixed)

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

JohnnyX’s picture

No release at project page? Also no dev version?

dasjo’s picture

Status: Closed (fixed) » Active

reopening according to #26

Bèr Kessels’s picture

JohnnyX’s picture

Ok, thanks. I'll try it but why no release here at drupal.org?

Yaron Tal’s picture

Since there is no drupal 7 version on d.o (and thus I couldn't make a normal bug report) please excuse me for hijacking this report.

On line 321 of the Drupal 7 version on github the class of the url is given as a string:
'class' => "tagadelic level$weight",

While it should've been given as an array like this:
'class' => array("tagadelic level$weight"),

The string way (as is used now) will give a fatal error when the link is active (when showing the cloud block on the taxonomy pages).

Bèr Kessels’s picture

Status: Fixed » Closed (fixed)

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

borazslo’s picture

sub

campeon38’s picture

Hi everybody,

I'm posting this issue here, because there is not channel to post it. Basically, I'm using the Tagadelic module and I'm getting this two errors:

Notice: Undefined index: terms in theme_tagadelic_weighted() (line 314 of /var/www/clients/client1/web4/web/sites/all/modules/tagadelic/tagadelic.module).
Warning: Invalid argument supplied for foreach() in theme_tagadelic_weighted() (line 317 of /var/www/clients/client1/web4/web/sites/all/modules/tagadelic/tagadelic.module).

does anybody know what is going on?

PD: Using D7 Tagadelic and Cumulus modules.

Bèr Kessels’s picture

This issue is closed. Please open a new ticket for new issues. However, your issue was reported and dealt with AFAIK. So please search to find if you can contribute to an existing issue.

Richnou’s picture

Assigned: tanoshimi » Unassigned
Status: Closed (fixed) » Active

Hi,

I have exactly the same issue than Campeon38, #34, but I couldn't find a solution yet. I installed the Berkes' version, and I can see the cloud working fine, still I got hat message from Drupal...

Would be able to advice me please?

Thank you for your help.

Best regards,
Richard.

Bèr Kessels’s picture

Status: Active » Closed (fixed)

please do not re-open issues, unless you have detailed and solid information it is actually the same bug re-appearing.