Support from Acquia helps fund testing for Drupal Acquia logo

Comments

NancyDru’s picture

Title: Create Druipal 7 Version of this project. » D7 Version of Web Links
Issue tags: +Roadmap

Just making the title easier to locate on tracking pages.

juan_g’s picture

Summit’s picture

Hi,

Closed this thread http://drupal.org/node/1362878 in favor of this official one.
Is there any progress in this field please? I have a couple sites running on Web Links as you know.
Would love to be able to port these to D7, but my web links are the bottle neck right now.

Thanks a lot in advance for your reply.
Greetings, Martijn

juan_g’s picture

There is weblinks 7.x-1.x-dev (Last updated: February 25, 2011), but not a link on the main project page, that says "it isn't usable yet". I think probably they are planning to work on D7, since they are still maintaining and updating the D6 version.

hyperlogos’s picture

replying to subscribe and to beg for D7 migration path

Summit’s picture

Hi, Any news on a D7 Version of weblinks? The .dev version is so old?
Or otherwise any news how to convert D6 weblinks nodes to D7 nodes with links functionality?

greetings, Martijn

GStegemann’s picture

I tried to implement some fixes, but there is a lot to be changed. See below and #1084196: Fatal error: Call to undefined function db_rewrite_sql() in weblinks.module on line 1173.

-bash-3.2# diff /usr/src/local/drupal/7/Modules/weblinks/weblinks.admin.inc weblinks.admin.inc
402c402
<     $formats = array(FILTER_FORMAT_DEFAULT => '-default-');
---
>     $formats = array(filter_fallback_format() => '-default-');
410c410
<       '#default_value' => variable_get('weblinks_format', FILTER_FORMAT_DEFAULT),
---
>       '#default_value' => variable_get('weblinks_format', filter_fallback_format()),
Summit’s picture

Hi, as stated on that link, see: http://blog.worldempire.ch/story/howto-convert-module-dbtng
Is the new link from http://drupal.org/node/1696542#comment-6260964
I am not a programmer and on travel. Would be great to have a D7 version!
greetings, Martijn

GStegemann’s picture

And I'm not a PHP programmer either.

But anyway I converted already a lot of DBTNG related statements. And now I'm struggling with things like converting node_body_field(), filter_form() and forms to get the weblinks nodes displayed.

akalata’s picture

@GStegemann, can you share what you have so far? Or an external repo you can share?

GStegemann’s picture

Please see #1084196: Fatal error: Call to undefined function db_rewrite_sql() in weblinks.module on line 1173. I have attached a diff file to this issue. However, already have made more changes and will upload another one shortly.

GStegemann’s picture

Some more progress. During testing a notice is thrown in weblinks-link.tpl.php: undefined variable: link_status in include() in line 11. In the D6 version the same variable is referenced but no notice is thrown.

Does anyone know what is contained in $link_status? Is there a similar or replacement variable in D7?

Which context applies to weblinks-link.tpl.php? The same as for node.tpl.php?

NancyDru’s picture

I think that comes from the link checker code.

GStegemann’s picture

Yes, you are right. But then it has to be checked if it is available to create the variable.

GStegemann’s picture

Next, I think the "admin/settings/weblinks" menu links have to be changed to "admin/config/content/weblinks/..." to comply to the D7 rules. Am I correct?

NancyDru’s picture

#14 - you are correct.
#15 - sounds good to me.

Thanks for tackling this.

GStegemann’s picture

OK. You're welcome.

Other question: what is the D7 replacement for "taxonomy_admin_term_edit"? Maybe this: "taxonomy_term_edit_access"?

NancyDru’s picture

I would look for something like taxonomy_form_term().

Summit’s picture

Hi,

Is there a working D7 web links module to test now please?
Is the branch 7.dev the latest with these changes in this thread?

Thanks a lot in advance for answering!
Greetings, Martijn

GStegemann’s picture

I've implemented several changes already, which are not commited yet.

@Nancy: would you mind to give me commit access?

NancyDru’s picture

I don't have the authority; Robert will have to do it.

Summit’s picture

Hi,
In the meantime, may be winzip your latest version please GStegemann?
Thanks a lot in advance for your reply!

Greetings, Martijn

Summit’s picture

Hi,
Does your D7 weblinks also holds the views handlers?
Right now updating a site from D6 to D7, the weblinks view handler is missing. On the Weblinks URL field it says Broken/missing handler.

Thanks a lot in advance for your reply!

Greetings, Martijn

GStegemann’s picture

I'm not really sure. At least I can view and edit Weblinks nodes.

The Weblinks Users form still needs some fixes. Currently I'm struggling with the account object when attempting to setup the Weblinks User form. The following notice is thrown

Notice: Undefined property: stdClass::$homepage in weblinks_user_page() (line 8 of /var/www/html/cm7/sites/all/modules/weblinks/weblinks.user.inc). => 

So the question is where is the property "homepage" gone in D7? Was this property renamed from D6 to D7?

NancyDru’s picture

I don't recall a homepage being required, nor being even in D6. I think it was in D5. In the interests of expediency, I'd say to throw it away.

Gerhard, until Robert grants you access, I can commit anything you send me.

Summit’s picture

The weblinks 7.dev from the modulepage is not showing in D7 contenttypes.
Is yours @GStegemann?

i can see my weblinks, I can alter them. But I can not change the weblinks type and can not use specific weblinks viewfields within views.

Greetings, Martijn

GStegemann’s picture

So you mean it may be a relict from D5? Anyway, do you have an idea what was aimed by this piece of code?

function weblinks_user_page($account) {
  $save_hp = $account->homepage;
  unset($account->homepage);
  $trail = array(l(t('Home'), ''), theme('username', $account, array('levels' => FALSE)));
  $account->homepage = $save_hp;
  drupal_set_breadcrumb($trail);

Regarding committing: first I would like fix the weblinks_user_page function.

GStegemann’s picture

Yes, I on my site the Weblinks content type is shown (see attached screen shot).

NancyDru’s picture

Wow, who was that silly woman who didn't document that better? It looks like an attempt to change the breadcrumb on the user account page. It really doesn't look important, but if you have a D6 site, you might want to see what it does.

Summit’s picture

Please..please send in winzip your Web Links version. I can test with you then, ok?
Greetings, Martijn

GStegemann’s picture

FileSize
57.02 KB

Here a screen shot of weblinks_user_form under D6.

And next more notices are raised for undefined properties 'promoted' and 'moderated'. I think those should be checked by isset before attempting to evaluate them.

GStegemann’s picture

I will try to upload a zip file tomorrow. Is that OK?

Summit’s picture

Yea great, good night for you.
Greetings, Martijn

GStegemann’s picture

Under D7 weblinks_user_form themes (through theme_weblinks_user_form) some output, but almost nothing is displayed (see screen shot). Could that be possibly a CSS problem?

NancyDru’s picture

It should be a list of links that the user contributed. But I see nothing in D6 for the breadcrumb.

Summit’s picture

Hi Nancy, Yes in D6 it is a list of the weblinks a user has contributed. This is easy information and it would be great to also have this on D7!
Greetings, Martijn

GStegemann’s picture

Regarding #35: the breadcrumb is displayed on top of this list, above "My account".

GStegemann’s picture

FileSize
79.28 KB

Here is a first ZIP upload of my D7 development version of the Web Links module.

@Nancy: if you want you may commit my changes, i.e. all files newer than 2011/2/26. Thanks.

NancyDru’s picture

Thanks, Gerhard. I have committed your code.

GStegemann’s picture

Many thanks. However, I forgot to remove the drupal.org packaging information from all .info files. I hope it does not hurt. I will fix this the next time.

NancyDru’s picture

Got them. The ones that haven't been converted may be an issue as there is a known problem with the packaging script adding a "core" parameter.

Summit’s picture

Hi, testing the D7 Web Links of 28th feb. Two bugreports until now: http://drupal.org/node/1931210
Again thanks for moving this to D7!
greetings, Martijn

juan_g’s picture

Great news, thank you very much. A link to the recently updated weblinks 7.x-1.x-dev from the Web Links project page would be really great, so that users know and test it.

NancyDru’s picture

Done.

GStegemann’s picture

I have more changes/fixes in the pipeline. However, before uploading them I have a question regarding the "old" update hooks. Shall I remove them fully? Or should they converted to D7 API to allow migration from elder sites as well? I.e. sites missing updates from #6100 until #6116? Or should all updates be applied before a migration is performed?

NancyDru’s picture

I usually remove all the old updates. You can use hook_update_last_removed() to require migration from the latest 6.x version.

GStegemann’s picture

OK, then I will do it the same way.

GStegemann’s picture

FileSize
78.55 KB

Here is a second ZIP upload of my D7 development version of the Web Links module which includes all recent patches. However, the issues described in #17 and #24 are still open.

@Nancy: you may commit my changes, i.e. all files newer than 2013/3/2. Thanks.

Anticosti’s picture

Thank you so much pals for your work on Web Links.
Just installed (weblinks-7.x-1-dev_2.zip), to give it a try, and I have been able to create couple web links only when Web Links Checker is not activate.

If I activate Web Links Checker then it is not possible.

I can't remember exactly at which steps the errors were thrown but... here's the list I copy/pasted:

Notice : Undefined variable: order dans _weblinks_get_query() (ligne 1202 dans /home/user/public_html/sitedev/sites/all/modules/weblinks/weblinks.module).

EntityMalformedException : Propriété de bundle manquante sur l'entité de type taxonomy_term. dans entity_extract_ids() (ligne 7633 dans /home/user/public_html/sitedev/includes/common.inc).

Fatal error: Cannot use object of type stdClass as array in /home/user/public_html/sitedev/includes/theme.inc on line 1054

Hope this could be of some kind of help to finish up this long awaited module update.

Cheers,

GStegemann’s picture

You're welcome and thanks for your feedback.

If I activate Web Links Checker then it is not possible.

Just to let you know: Web Links Checker is not ported yet. Anyway, I will look into it and hope to have it changed shortly.

NancyDru’s picture

Changes committed with attribution.

GStegemann’s picture

FileSize
77.92 KB

Thanks a lot.

Here is the third ZIP upload of my D7 development version of the Web Links module which includes fixes for the Web Links Checker module and URL redirect function.

@Nancy: you may commit my changes, i.e. all files newer than 2013/3/17. Thanks again. And it would be great if yon can remove the file weblinks_filter.info.bak. I added it accidently to the ZIP file.

One other question: is the function _weblinks_checker_fix_url still needed for D7? Or is the mentioned core bug already fixed?

/**
 * Helper function for URLs.
 */
function _weblinks_checker_fix_url($url) {
  // This is needed for WYSIWYG editors.
  $url = strip_tags(trim($url));

  // Note that we have to try to bypass a core bug in valid_url(). See http://drupal.org/node/295021.
  $y = drupal_parse_url($url);
  return ($y['scheme'] ? $y['scheme'] .'://' : NULL)
    . $y['host']
    . ($y['port'] ? (':'. $y['port']) : '')
    . ($y['path'] ? '' : '/')
    . $y['path']
    . ($y['query'] ? '?'. rawurlencode($y['query']) : NULL);
}
NancyDru’s picture

That bug still shows "Needs work".

Committed with attribution.

GStegemann’s picture

Thanks.

OK, _weblinks_checker_fix_url is then still needed.

GStegemann’s picture

Next thing: in D7 the property $node->taxonomy is not set anymore while loading a node. This has to be handled by the module itself. See also #978242: Document the changes to taxonomy.module properly to avoid confusion about missing $node->taxonomy property and http://drupal.org/node/1242026.

Has someone some good replacement code for this? Or should we introduce a field for this?

Currently a weblinks node becomes unclassifed when a new version is saved.

NancyDru’s picture

You should deal directly with the field, if it exists. We tried very hard several years ago to remove dependencies on Taxonomy.

GStegemann’s picture

Currently there is no such field defined in the content type 'weblinks'. Basically the Web Links module relied on the table term_node only which does not exist anymore in D7.

But what about this module: http://drupal.org/project/taxonomy_entity_index?

NancyDru’s picture

Term_node is more or less replaced by taxonomy_index. For this module, it should be pretty much equivalent.

I hesitate to add a dependency on another module. That one extends term references to all entities, but the core taxonomy_index is only for node entities. Given that Weblinks are nodes, that should suffice, I would think. The biggest question there is about unpublished nodes, and I don't know what core does if an unpublished node becomes published.

This will create a $node->taxonomy array as in D6.

function nancy_node_view($node, $view_mode, $langcode) {
  $lang = $node->language;
  $keys = array_keys((array) $node);
  $node->taxonomy = array();
  foreach ($keys as $key) {
    if (substr($key, 0, 6) == 'field_') {
      foreach ($node->{$key}[$lang] as $data) {
        if (isset($data['taxonomy_term'])) {
          $node->taxonomy[$data['taxonomy_term']->tid] = $data['taxonomy_term'];
        }
      }
    }
  }
GStegemann’s picture

Thanks for your code snippet. But I guess it will not work with the current implementation of Web Links, since there is no field field_taxonomy_term yet. I have tested it and the array was always empty.

To change this an update hook is probably needed to add such field to the content type and to setup the term in this field.

As of current we have to walk through taxonomy_index (as in weblinks_get_tree) to 'emulate' this. E.g. in hook_node_load.

The biggest question there is about unpublished nodes, and I don't know what core does if an unpublished node becomes published.

Yes.

Anyway, I guess that we have to add something like taxonomy_node_insert or taxonomy_node_update when saving a Web Links node. And taxonomy_node_delete when a node is removed.

GStegemann’s picture

FileSize
79.32 KB

I've got more things working, especially taxonomy related stuff.

Here is the fourth ZIP upload of my D7 development version of the Web Links module.

@Nancy: you may commit my changes, i.e. all files since 2013/3/19. Thanks again.

To get collapsible group titles working I've added the library 'drupal.collapse'. I'm not sure if this is really needed. Would you check if I have ported 'weblinks.admin.js' correctly (changes required to be jQuery 1.3 compatible).

I've also added some helper functions as a replacement for D6 taxonomy_form and taxonomy_term_select.

I still need some ideas how to update nodes with an assigned taxonomy term to not break them.

GStegemann’s picture

FileSize
80.19 KB

I have fixed more taxonomy issues and uploaded a fifth ZIP file.

All files since 2013/3/22 shall be commited. Or all files since 2013/3/19 when ZIP #4 ist not committed yet.

NancyDru’s picture

Committed

GStegemann’s picture

FileSize
79.93 KB

Many thanks.

Unfortunately there are two outdated files in ZIP #5: contribs/weblinks_checker/weblinks_checker.install, and contribs/weblinks_checker/weblinks_checker.js. Therefore I've created another ZIP with the actual files. Either you commit these two files again or undo the last commit of them. Sorry for this.

NancyDru’s picture

BTW, you should also remove LICENSE.txt - the packaging function adds that. Everything committed.

Summit’s picture

Hi @Gstegemann, trying the links page "admin/config/content/weblinks/links" I got:

Recoverable fatal error: Argument 3 passed to l() must be an array, null given, called in includes/common.inc on line 5547 and defined in l() (line 2413 of includes/common.inc

Thanks for your work on D7 upgrade so far.
Greetings, Martijn

GStegemann’s picture

Hello Summit,

I will look into it. However, I cannot reproduce it on my test site. Do you have more details, like any links created yet, using a vocabulary, etc.? Or a backtrace?

GStegemann’s picture

FileSize
73.19 KB

This is the seventh ZIP file which includes D7 changes of Web Links Blocks and the Pralexa module.

I have also fixed some issues in the Pralexa module and several PHP notices.

All files since 2013/4/3 shall be commited.

Known issues:
- the Taxonomy Image module is currenty ignored since it needs to be clarified how to support Taxonomy images under D7,
- adding a new link does not allow to assign a taxonomy term,
- adding a taxonomy term is currently broken when Web Links Blocks is enabled.

GStegemann’s picture

While testing some taxonomy functions of the Web Links vocabulary I discovered a propably serious property name clash with the taxnonomy module. When attempting to display all content using a specific taxonomy term, i.e. executing a link like 'taxonomy/term/253' the following errors are displayed:

Fatal error: Unsupported operand types in /var/www/html/cm7/includes/common.inc on line 2186
Uncaught exception thrown in session handler.

PDOException: SQLSTATE[08S01]: Communication link failure: 1153 Got a packet bigger than &#039;max_allowed_packet&#039; bytes: UPDATE {sessions} SET uid=:db_update_placeholder_0, cache=:db_update_placeholder_1, hostname=:db_update_placeholder_2, session=:db_update_placeholder_3, timestamp=:db_update_placeholder_4 WHERE ( (sid = :db_condition_placeholder_0) AND (ssid = :db_condition_placeholder_1) ); Array ( [:db_update_placeholder_0] =&gt; 1 [:db_update_placeholder_1] =&gt; 0 [:db_update_placeholder_2] =&gt; 192.168.2.27 [:db_update_placeholder_3] =&gt; batches|a:11: ...

and so on, returning at lot of data from the web server.

The originating error is most likely:

Recoverable fatal error: Argument 2 passed to url() must be an array, null given, called in /var/www/html/cm7/modules/taxonomy/taxonomy.module on line 904 and defined in url() (line 2178 of /var/www/html/cm7/includes/common.inc).

And this happens, as far as I understand the issue, that both modules - Web Links and D7 Taxonomy - uses a node object property name 'url', but for different purposes. This was not the case under Drupal 6.

To fix this I suggest to rename the Web Links node object 'url' property to something like 'wlurl', or similar. Is that OK? I believe there is no need to change the Web Links schema as well.

NancyDru’s picture

It may be the URL property. However, the max_allowed_packet size has plagued Drupal sites as long as I've been using it. The MySql default is 3M, but it should be more like 16M.

IIRC, $node->url was what themes used to link the node titles to. Take a look at some theme node.tpl.php files and see what they are using for that now. In Bartik, I see a $node_url variable, which would probably indicate the originating property is $node->node_url.

Function template_preprocess_node() creates $node_url from $uri = entity_uri('node', $node); A quick scan of the node.module looks like it's using $node->link. I could not find any url property. Nor can I find any reference $node->url in taxonomy.

I can't get a core issue search to complete, so you might try that later.

GStegemann’s picture

After increasing the max_allowed_packet to 16M (I thaught it was already set) the picture changes a little. I could now capture a backtrace when this happens:

Recoverable fatal error: Argument 2 passed to url() must be an array, null given, called in /var/www/html/cm7/modules/taxonomy/taxonomy.module on line 904 and defined in url() (line 2178 of /var/www/html/cm7/includes/common.inc). =>

 ... (Array, 17 elements)
      16: url() (Array, 2 elements)
          file (String, 24 characters ) includes/common.inc:2178
          args (Array, 2 elements)
              0 (NULL)
              1 (NULL)

  15: template_preprocess_taxonomy_term() (Array, 2 elements)
     file (String, 36 characters ) modules/taxonomy/taxonomy.module:904
     args (Array, 2 elements)
         0 (Array, 18 elements)
             elements (Array, 11 elements)
                #pre_render (Array, 1 element)
                    0 (String, 30 characters ) _field_extra_fields_pre_render | (Callback) _field_extra_fields_pre_render();
                #entity_type (String, 13 characters ) taxonomy_term
                #bundle (String, 12 characters ) vocabulary_9
                #view_mode (String, 4 characters ) full
                #theme (String, 13 characters ) taxonomy_term
                #term (Object) stdClass
                    tid (String, 3 characters ) 278
                    vid (String, 1 characters ) 9
                    name (String, 14 characters ) Sonstige Links
                    description (String, 62 characters ) Alle Links, die nicht anderweitig zugeordnet we...
                    format (String, 1 characters ) 2
                    weight (String, 1 characters ) 0
                    language (String, 3 characters ) und
                    i18n_tsid (String, 1 characters ) 0
                    vocabulary_machine_name (String, 12 characters ) vocabulary_9
                    rdf_mapping (Array, 5 elements)
                    metatags (Array, 0 elements)
                    entity_view_prepared (Boolean) TRUE
                #language (String, 2 characters ) de
                #attached (Array, 1 element)
                    css (Array, 1 element)
                        0 (String, 29 characters ) modules/taxonomy/taxonomy.css
                description (Array, 5 elements)
                #sorted (Boolean) TRUE
                #children (String, 0 characters )
            theme_hook_suggestions (Array, 0 elements)
            zebra (String, 3 characters ) odd
            id (Integer) 1
            directory (String, 38 characters ) sites/all/themes/adaptivetheme/at_core
            classes_array (Array, 1 element)
                0 (String, 13 characters ) taxonomy-term
            attributes_array (Array, 0 elements)
            title_attributes_array (Array, 0 elements)
            content_attributes_array (Array, 0 elements)
            title_prefix (Array, 0 elements)
            title_suffix (Array, 0 elements)
            user (Object) stdClass
            db_is_active (Boolean) TRUE
            is_admin (Boolean) TRUE
            logged_in (Boolean) TRUE
            is_front (Boolean) FALSE
            view_mode (String, 4 characters ) full
            term (Object) stdClass
                ∞ (Recursion)
        1 (String, 13 characters ) taxonomy_term

        14: theme() (Array, 2 elements)
        13: drupal_render() (Array, 2 elements)
        12: drupal_render() (Array, 2 elements)
        11: drupal_render() (Array, 2 elements)
        10: drupal_render() (Array, 2 elements)
         9: render() (Array, 2 elements)
         8: include() (Array, 2 elements)
         7: theme_render_template() (Array, 2 elements)
         6: theme() (Array, 2 elements)
         5: drupal_render() (Array, 2 elements)
         4: drupal_render_page() (Array, 2 elements)
         3: drupal_deliver_html_page() (Array, 2 elements)
         2: drupal_deliver_page() (Array, 2 elements)
         1: menu_execute_active_handler() (Array, 2 elements)
         0: main() (Array, 2 elements)
    Krumo version 0.2.1a | http://krumo.sourceforge.net [Click to expand. Double-click to show path.]
 Called from /var/www/html/cm7/includes/common.inc, line 2178  

Fatal error: Unsupported operand types in /var/www/html/cm7/includes/common.inc on line 2186

So there is definitely something wrong while rendering Web Links terms by the taxonomy module. But what?

NancyDru’s picture

Update 7 was committed.

If you change to $node->weblinks_url, does the issue go away? Is anything else broken?

GStegemann’s picture

Thanks for the commit.

Regarding the change: not yet. Before I do such changes (quite a lot of statements) I want to be sure that no other side effect causes the failure.

Is there a documentation which describes all node properties in D7 and their usage? OK, I found one: http://drupal.org/node/49768

Summit’s picture

Hi,

googling to help with the error got me to http://drupal.org/node/1608408.
I hope this helps.
greetings, Martijn

NancyDru’s picture

That's probably as good as a list as there is. But any module, especially Fields, may add to the content.

GStegemann’s picture

Thanks. But it was a different thing.

Anyway, the error occurs here (last line):

function template_preprocess_taxonomy_term(&$variables) {
  $variables['view_mode'] = $variables['elements']['#view_mode'];
  $variables['term'] = $variables['elements']['#term'];
  $term = $variables['term'];

  $uri = entity_uri('taxonomy_term', $term);
  $variables['term_url']  = url($uri['path'], $uri['options']);
...

So what is causing entity_uri not to return an array in $uri['options']? But, as documented, entity_uri will return 'NULL if the entity has no URI of its own'. So maybe the taxonomy module should check the return value?

Maybe this error occurs due to a missing uri callbank in Web Links:

$info['taxonomy_term']['bundles'][$machine_name]['uri callback'] = 'weblinks_uri';

As far as I can see there is no function 'weblinks_uri', right?

Is fixed! I added the missing callback function and it works as expected. I had to replace the D6 hook 'hook_term_path' by a D7 solution and implemented only half of it.

NancyDru’s picture

That is probably the missing puzzle piece.

GStegemann’s picture

Yes, that was the missing puzzle piece.

Should we file an issue against the Taxonomy Module that the return value of entity_uri should be checked before calling 'url'?

NancyDru’s picture

You could, but I would expect a "Won't fix" by saying that a "proper implementation" wouldn't return a bad value.

However, a change to the D6->D7 migration guide would seem reasonable to me, due to the elimination of the hook.

GStegemann’s picture

FileSize
73.3 KB

May happen, yes. But even in case of a "proper implementation" errors may occur.

Regarding the D6->D7 migration guide: that's a good idea. Will you do this? For implementation details see 'hook_entity_info_alter' and 'weblinks_uri'. 2nd: a description how to replace 'taxonmy_admin_term_edit' should be added as well.

The most recent fixes are included in my 8th ZIP file.

NancyDru’s picture

GStegemann’s picture

Yes, I know this. From there I have implemented the hook_term_path replacement. But that this needs a callback function was not obvious to me.

Another thing: in the 6.x-2.x-dev branch I have found two commits for the following changes:

  • Issues 1534584 and 1534552, Fix Sort order and minimal validation
  • Issue #1026858 by johnathan1055: Fix E_NOTICE in filter


  • As far as I can see these changes are not included in the 7.x-1.x-dev branch. Shouldn't those changes be merged into the 7.x branch as well?

    Any plans to release the current 6.x.2.x-dev version?

    NancyDru’s picture

    Yes, the 7.x branch should have been built on the latest 6.x-2.x code.

    GStegemann’s picture

    OK, I have merged the changes into 7.x-1.x-dev version.

    During testing I saw this:

    Notice: Undefined index: #post in weblinks_checker_validate() (line 149 of /var/www/html/cm7/sites/all/modules/weblinks/contribs/weblinks_checker/weblinks_checker.module).
    

    which happens here:

    /**
     * Implementation of hook_validate().
     */
    function weblinks_checker_validate($form, &$form_state) {
      if ($form['#post']['op'] == t('Delete')) {
        return '';
      }
    

    Which array element has be to checked now for a post or submit action?

    NancyDru’s picture

    $form_state['values']['op']

    Is that all that's there?

    GStegemann’s picture

    OK, thanks.

    No, not really. But I have fixed already a lot of things.

    Question: should the 'hook' 'weblinks_checker_validate' not be renamed to something like 'weblinks_checker_xxx_validate' to prevent a clash with 'hook_validate'? Reason: a 'hook_validate' has three arguments a "form_validate" hook has only two arguments. Or is that not a problem?

    However, a big problem is how to update the taxonomy_index table when Web Links node is saved. Currently the taxonomy relation is removed when saving a node! Either we have to use a field for this, or implement some logic in 'weblinks_write' around calling 'drupal_write_record'. Or do you know a better trick?

    Third: how about the conversion sub modules (Web Links Convert Janode Package, Web Links Convert Links Package, and Web Links Convert LinksDB)? Are they all still needed?

    Gerhard

    Summit’s picture

    Hi,
    With D7 shouldn't you not allways use a field for taxonomy-node relation? Like other nodetypes do?
    greetings, Martijn

    GStegemann’s picture

    Probably yes. Do you know about any example implementations?

    Gerhard.

    Summit’s picture

    Hi, Just like adding a vocabulary to a nodetype/contenttype "page: in D6 or D7. Use a contenttype and add a termfield. Thats it!

    What you could do I think is:
    - build the vocabulary Weblinks through the install if not existing.
    - add to the readme to get Weblinks working for Vocabulary Weblinks the steps to take
    - change the radiobuttons code: "Use Weblinks", Use other vocabulary.

    greetings, Martijn
    greetings, Martijn

    GStegemann’s picture

    OK, your scenario describes the 'manual' way. But within a module this has to be solved programatically.

    Anyway, I found a good implementation in the Forum module. I will checked that in more detail.

    Gerhard.

    GStegemann’s picture

    FileSize
    76.01 KB

    After some investigation I got the taxonomy field stuff working.

    Here is my nineth update ZIP, which includes this change and an upgrade path. Additionally I've fixed some more PHP issues and notices in the Web Links Checker module, see ChangeLog.

    One thing I have not tested yet is what happens when the Navigation Vocabulary will be changed in the Web Links settings.

    @Nancy: what about the conversion modules? Are they still needed?
    Do you know for whatsoever reason the variable 'weblinks_6113' was defined? I think it is not needed and not used anymore.

    NancyDru’s picture

    No, I wouldn't worry about the conversion stuff. If anyone wants them, tell them to convert them on D6.

    Off the top of my head, no I can't remember what a particular update was for. I would remove all of them and use hook_update_last_removed().

    NancyDru’s picture

    committed

    GStegemann’s picture

    Thanks for committing.

    The variable 'weblinks_6113' was in fact used by update #6113 to ensure, that the update code will be executed only once.

    weblinks_update_6113	Implementation of hook_update_N(). Change to DATETIME type.
    

    I will drop the variable with the next update.


    Next, the Alexa pagerank retrieval does currently not work. After Amazon has acquired Alexa this service requires a registration.

    In order to use the Alexa Web Information Service, you must first sign up for an Amazon Web Services account, and then subscribe to the Alexa Web Information Service.

    So currently this function seems to be useless. Further usage will require an update of the API code and the Access Keys made available to the module. Any activities planned here?

    NancyDru’s picture

    I don't know how many people were using that feature. In today's reality, page ranks are largely meaningless.

    GStegemann’s picture

    FileSize
    76.09 KB

    OK. Let's see if someone will asking for it.

    I uploaded now the 10th update ZIP. It contains some fixes in hook_install regarding the creation of the term reference field and in weblinks_checker setting up link_status, also some fixed typos in hook_uninstall.

    NancyDru’s picture

    Committed

    GStegemann’s picture

    FileSize
    76.3 KB

    Thanks.

    I just uploaded the 11th update ZIP. It includes fixes for the settings CSS file and to make the setting 'Link description display' working. Next I implemented changes to render the 'Links user page' correctly. And I deactivated all the code to process the D6 body field.

    NancyDru’s picture

    Committed

    Anticosti’s picture

    Hey, Hey Hey ;-) !!! Great job GStegemann :)
    All seems to be working ultra fine and no errors.
    Was worth the waiting...
    Also: Thanks to NancyDru for backing you up on this :)

    Cheers,

    GStegemann’s picture

    You're welcome and many thanks for your positive feedback.

    @Nancy, maybe it's now the time to update the homepage to show the current status of the D7 branch. Maybe something like 'Have created a branch which is available for testing now.' or similar.

    And one other thing I would like to know is what replacement is available for the missing function 'taxonomy_image_display' from Taxonomy Image module?

    NancyDru’s picture

    The project page has been updated.

    Taxonomy Image has not yet been ported, so just rip that stuff out.

    GStegemann’s picture

    Thanks.

    Regarding Taxonomy Image: Really? Any plans to port it somewhen? What are the alternatives? Attaching an image field to a content type?

    NancyDru’s picture

    Yes, I'd like to do it, but the core module won't have much left because Fields largely makes in unnecessary.

    GStegemann’s picture

    As a next step I have ported the Token integration of Web Links to D7. This required also to change the token names to be compliant with D7.

    First I have added a new token type 'weblinks'. Next all Web Links related tokens are now named 'weblinks:token-name'. E.g 'weblinks-url' has been changed to 'weblinks:url', etc. However, I have not changed all Web Links tokens to a chained fashion, e.g. 'weblinks-url-raw' is still 'weblinks:url-raw'.

    Is that OK so far? Or should all tokens be named in a chained way?

    Second I found a note to this issue http://drupal.org/node/213751 in the Web Links token implementation. I think this note is not relevant anymore. So even the code may be changed to not check the presence of the node's title property anymore.

    Summit’s picture

    Hi,
    Thanks for all your great work already.
    Did you succeed in using weblinks URL in views?
    When I try adding:

    Web Links: URL
    The web address for the link.
    

    I got:

    The handler for this item is broken or missing and cannot be used. If a module provided the handler and was disabled, re-enabling the module may restore it. Otherwise, you should probably delete this item.
    

    Thanks for going into this!
    Greetings, Martijn

    NancyDru’s picture

    Gerhard, I think you know the answer to the tokens issue.

    Martjin, if the handlers have not been updated to Views 3, they are not going to work.

    GStegemann’s picture

    Regarding tokens: you mean I should change all token names to chained names?!

    Regarding Views: yes that's the issue. I have to adapt everything to Views 3. I have started, but it is not done yet. Still needs some time.

    GStegemann’s picture

    FileSize
    76.82 KB

    So here is now my twelfth update. This version includes the port for Token support and the long awaited Views 3 handler. And it includes fixes for issue #1982828: Array appears in all created weblinks.

    @Nancy, this commit requires a rename of file 'token_weblinks.inc' to 'weblinks.tokens.inc'.

    Note: in case if someone installs this version directly from the ZIP file, the module has to be re-enabled to make all the changes working.

    Summit’s picture

    Hi, again thanks for your great job.
    I have a problem using Weight module, see: http://drupal.org/node/1987962
    May be this is because Weblinks-table self somehow also has a weight field which is not correctly integrated?
    greetings, Martijn

    Summit’s picture

    Hi,
    I think the whole Weight stuff should be ripped out see my remarks on http://drupal.org/node/1987962
    I got it working with altering "Required" TRUE to FALSE.

    Greetings, Martijn

    Summit’s picture

    Hi Nancy,
    Could you decide whether the Weight stuff should be ripped out? I think so because of your recommandation here: http://drupal.org/node/1363410#comment-5926806
    Thanks for your reply in advance.
    greetings, Martijn

    NancyDru’s picture

    Update 12 committed

    Yes, I vote for ripping the weight stuff out - should have been done long ago.

    GStegemann’s picture

    Thanks for committing.

    Ok, maybe a good point in time to do so, if all agree. How about Robert?

    And next, what shall happen to installations where the Web Links weight was used? Wouldn't this not require an update procedure? Or are such cases quite rare and can be disregarded?

    Gerhard

    NancyDru’s picture

    Robert seems to be MIA.

    Yes, there should be an update done (IIRC, there was a column in the table). This is true if even one user was using it - and that is probably Martijn.

    GStegemann’s picture

    FileSize
    76.93 KB

    Anyway, in the meanwhile I've uploaded a thirteenth ZIP which includes fixes for the following issues:

    • #1989308: String "Enter a single web address (URL), including the "http://"." run through t().
    • #1987962: disable Web Links Weight field in edit form when module Weight is available.
    NancyDru’s picture

    Committed.

    GStegemann’s picture

    Many thanks.

    NancyDru’s picture

    Okay, Gerhard, you are free to commit on your own now.

    GStegemann’s picture

    Nancy, great news. Thanks.

    So, what's up next? Removing the weight feature?

    Gerhard.

    NancyDru’s picture

    You're in the driver's seat now.

    Anticosti’s picture

    Just tried weblinks-7.x-1-dev_13.zip
    All seems fine except... if you do the following:
    01. admin/config/content/weblinks
    02. check: Link settings ­­> Link description display: Teaser length
    03. Create a new Web link
    04. Promote it to the front page
    05. Visit your front page
    06. You'll get this error message:
    Notice : Undefined index: summary in weblinks_weblinks_preprocess() (line 736 in /home/youruser/public_html/yourwebsite/sites/all/modules/weblinks/weblinks.module).

    and no description summary showing ...

    Can anyone reproduce ?

    Cheers,

    GStegemann’s picture

    Many thanks for reporting this issue.

    Can anyone reproduce ?

    No, not yet. But anyway, the definition of the body text field has changed a lot in D7 and how a teaser is handled. I will look into it.

    GStegemann’s picture

    Status: Active » Needs review
    FileSize
    1.92 KB

    To fully understand the issue I have some questions:

    • Have you changed the definition of the content type 'Web Links'?
    • Is there still the body text field 'Link Description'?

    As long as the content type is intact there should be always an index 'summary' in the nodes body field.

    However, I have attached a patch which should fix your issue and makes the 'Link Description' setting fully working. Please apply and test the patch and let me know if it resolves the issue.

    Anticosti’s picture

    Yes Sir ;-) Thank you GStegemann :)
    Issue solved with your patch.

    Thanks again for your great coding and support.

    Cheers,

    Summit’s picture

    Status: Needs review » Reviewed & tested by the community

    Hi, Yes resolved here also.
    greetings, Martijn

    GStegemann’s picture

    Thanks for testing and your feedback.

    Gerhard

    GStegemann’s picture

    Thanks as well for testing and your feedback.

    I will commit the change soon.

    Gerhard

    GStegemann’s picture

    Change committed now.

    Gerhard

    NancyDru’s picture

    Thanks again, Gerhard. I do appreciate your taking on this module.

    It's probably time to close this issue and let new problems be separate issues.

    GStegemann’s picture

    Status: Reviewed & tested by the community » Fixed

    Nancy, thanks for your acknowledgement.

    Yes, this issue should be closed now.

    Gerhard

    Status: Fixed » Closed (fixed)
    Issue tags: -Roadmap

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

    jonathan1055’s picture

    Added related issue which is tracking the final tasks for 7.x release 1.0