I might consider using this module some time soon, but I need it working with drupal 5.x, so I tried my hand at upgrading it.

I have not fully tested it yet; I also have not fully checked each function according to the converting/upgrading guidelines. http://drupal.org/node/64279

I have rearranged the modules functions, and I did make some small changes, but I have not added any new features.

If I do end up using this module I will be adding some features and maybe changing the way it works a bit. If I do have any changes to post I will be posting then as additions to this patch.

Hope it helps.

Comments

jondoesdrupal’s picture

Hi NaX, I've been doing some development for 5 recently myself so am now familiar with it too, but this is still appreciated as I've not got much spare time for this.

I'll try and check it out later on and get back to you. I'd also be interested in the features you have in mind?

Cheers,

Jon

NaX’s picture

StatusFileSize
new15.07 KB

Ok, I have made some changes; here is an update on the first patch.

What I have done is I have added the ability to take notes of other nodes. I think it is inline with this feature request http://drupal.org/node/118044

Here is a list of changes.

- added another table
- added another column to metadata table
- added settings page
- changed block
- added tabs for nodes that are allowed to take notes on
- added my notes menu item
- added tabs and submenu items for my notes page
- notes are divided into 2 types, personal notes and notes that are related to anther node

Have a look and tell me what you think.

NaX’s picture

StatusFileSize
new642 bytes

Small bug fix

pjb’s picture

I've tried applying these patches to the current 4.7 release version of the module but I get a very large .rej file for notepad.module. Are these patches against the current release or the CVS version?

Thanks! :)

NaX’s picture

The first patch is on 4.7 version 1.2 2007/02/11
The other patch’s are add on patch’s and need to be applied after the first patch has been applied.

I tested the first patch with this command patch -p0 < notepad_5.x.patch. The patch file was in my modules directory when I ran the patch.

Do you want me to upload the full tar.gz of my laterst version. As the file attach feature does not allow tar.gz files I could appending .txt, and the file just needs to be renamed without the .txt

jondoesdrupal’s picture

All sounds good. Won't get a chance to inspect it myself for a day or two, but I'm not too fussed as long as it works ok, so would you like me to just give you cvs access to add your release yourself?

jondoesdrupal’s picture

Hey mate, not having much joy with the patch, could you go ahead with posting the ready patched files?

Thanks,

Jon

NaX’s picture

StatusFileSize
new5.16 KB

Full 5.x package with my changes.
Do you want me to upload the full package without my changes and only the upgrade?

jondoesdrupal’s picture

Great, thanks, I'll take a look when I get home tonight.

Re: a copy with just the upgrade, I imagine there's no need, unless someone says they particularly want it? New features can surely only be a good thing!

jondoesdrupal’s picture

OK, have now had a chance to have a try. Only a quick test, but here are my thoughts / findings:

- the .install didn't work for me - simply no table created and no errors logged. Any ideas? In fact, this is what I experienced when I tried creating one in the first place, hence why there never was one. I suppose once that's sorted, an upgrade path should be implemented too.
- the add note part - your url in hook_link was pointing to the wrong url, so corrected that and it now works.
- removal of the priority listing in the block - I personally prefer it to be there, so I figured i'd just make it an option in the block config?

Other than that, it all looks good. Thanks for the other general improvements under the hood with caching and hook_menu.

I'll try and take a look at those points myself sometime soon, unless you get a chance yourself.

NaX’s picture

StatusFileSize
new1.13 KB

Thanks for the dug info.

I have found the install problem and have tested it from a fresh install and an uninstall and it worked fine. See attachment.
I also see the broken link in hook_link.
When it comes to the display of the priority in the block, I don’t think a configuration option will me necessary, maybe just documentation as the block is displayed using a theme function and priority is being passed in.

EG.


function phptemplate_notepad_block_content($rows) {
  $items = array();
  if (count($rows)) {

    // Add the links to the header
    $links[] = array('title' => t('My Notes'), 'href' => 'notepad');
    $links[] = array('title' => t('add new note'), 'href' => 'node/add/notepad');
    $output = theme('links', $links, array('class' => 'links inline'));

    foreach ($rows as $row) {
      $items[] = l($row->priority .' : '. $row->title, 'node/'. $row->nid, array('title' => check_plain($row->body)));
    }

    // Now render the list using theme_item_list
    $output .= theme('item_list', $items, NULL, 'ul');
  }
  return $output;
}

jondoesdrupal’s picture

Yes, I took a quick look at another .install and spotted the issue too - obvious now you see it really!

Re: priority in the listing, I just figured that if it was gone it was something you'd chosen to remove so if that's not the case then np, I'll pop it back in.

I'll merge the changes and do a few little things here and there and release a new branch shortly.

jondoesdrupal’s picture

Assigned: Unassigned » jondoesdrupal
Status: Needs review » Closed (fixed)

Changed merged and first Drupal 5 release relased.

Thanks for your work NaX.