Hi,

I'd be happy to know what the current plans for porting pageroute to Drupal 5.x are.

I saw the support request http://drupal.org/node/101656, telling me that "I'll start to port it to 5.0 as soon as the RC is out and I've ported the other nodeprofile modules."

Since this information is three months old, I thought I may ask about the current status, because I need this information for planning the 4x->5x upgrade.

Thank you and keep up your tremendous work.

Comments

fago’s picture

fago’s picture

ehm sry, page

jpetso’s picture

Title: When will there be a 5.x version ? » Port pageroute to Drupal 5
Assigned: Unassigned » jpetso
Category: support » task

This task is the next thing I'll tackle. I've begun to port the module, but it's a big pile of code and as such will take a while. I hope to get it done till the end of February, when there is a patch to show off then you'll get to see it here.

techczech’s picture

Thank you very much for doing this. This is the last module I need before I upgrade my last 4.7 site to 5.1 - and it is one of the best. I'll be testing it as soon as it's out.

jpetso’s picture

StatusFileSize
new71.29 KB

Ok, this is a first shot at the port. It includes everything that was needed in order to follow the porting guidelines, and should be a solid base to work from. Also, the most basic functionality seems to work. But I haven't had the time for thorough testing of all the diverse use cases (and there's no end of them) so I don't believe that pageroute 5.x is usable yet. I didn't yet test the pageroute_workflow and pageflow_subform modules. There may also be undocumented changes in Drupal's form generation which are apt to negatively

What has to follow now is testing, testing, more testing, and debugging the found errors. So everyone who wants to accelerate a stable version of pageroute 5.x, do report bugs like there's no tomorrow.

Known bugs:
- pageroute_menu() (that is, all pageroutes) doesn't work with $may_cache = TRUE, so I switched the menu items to !$may_cache. I have no idea why this doesn't work (and obviously did before), input appreciated.

Feedback highly appreciated.

jpetso’s picture

Status: Active » Needs review

Change status accordingly.

jpetso’s picture

StatusFileSize
new93 bytes

We also need the .info files, they're not in the patch. Let's do it piece by piece, here's the one for the main pageroute module.

jpetso’s picture

StatusFileSize
new150 bytes

.info file for pageroute_ui.

jpetso’s picture

StatusFileSize
new148 bytes

.info file for pageroute_workflow.

jpetso’s picture

StatusFileSize
new168 bytes

.info file for pageroute_subform. That's it for now.

Operations-1’s picture

Hi, is it possible to create a 5.x branch with the patches? I cant patch.... thanks very much...

fago’s picture

Status: Needs review » Active

thanks.
I've just committed it to HEAD, which will be used for 5.x development now.

Bugs I ran over:
I created a pageroute with a node edit form and a node display form, set to node id 0. Calling it without parameter let me create the node as desired, but I was redirect to the node view instead of to the next page.

Then trying to edit it (parameters 0/59) failed, the output was just "Array".
Then I tried the node display tab with these parameters which should show node with id 59. That worked, but there were some html above it: "pform action=..>, resulting a not working form.

a short test with a node management page ended with the same printed html.

jpetso’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new25.89 KB

This patch here fixes all the mentioned bugs, and quite a few more. Additionally, the admin interface was overhauled a bit ("edit route" being a tab of the own route, and proper Drupal 5 capitalization everywhere).

The problem with the "pform" markup was that I tried to add the $form['#base'] property after the form had been rendered, which naturally doesn't work. So I removed the previously introduced pageroute_get_form() function again, and added a pageroute_decorate() function instead which wraps pageroute_add_buttons(), pageroute_add_tabs() and the adding of the '#base' property.

I'm pretty confident that pageroute is now bug-free enough for real use.

fago’s picture

Status: Reviewed & tested by the community » Active

thanks I've committed it to HEAD.

I've done some tests, it's working much better now, thanks.

Problems I've found:

in the node management page:
* deleting a node doesn't work, the confirm page does just show: Array
* adding a node doesn't show a correct node-adding page. the tab-like submit buttons are missing.
* after adding you get redirected to the node view, not back to the node management page
* if I go through the route as another use the author isn't set correctly for new added nodes through the node management page

* the same happened with a normal add page (it doesn't set the author)
* the node edit form page type doesn't show tab-like submit buttons nor forward-back buttons if it displays the node_add() form

jpetso’s picture

StatusFileSize
new5.04 KB

Ok, this little patch solves all those issues (which were in fact just two errors in the code), also reenables menu caching, and more capitalization.
Also, the issue for nodefamily integration is solved with this fix.

jpetso’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new7.18 KB

Improved version of the patch, removing those exit; calls in favor of return;. Thanks to killes for noting this.

jpetso’s picture

StatusFileSize
new7.87 KB

killes found another shortcoming: in their current state, node creation forms don't show the help text for content types at the top, like they do at node/add/*. That's because node.module adds the help text only for pages with arg(0) == 'node' and arg(1) == 'add', and also depends on arg(2) for retrieving the type. (You can't really do it in any other way from hook_help().)

This patch includes all the changes from pageroute_5_more_fixes_v2.patch, and additionally adds the help text manually in pageroute_form_alter().

jpetso’s picture

StatusFileSize
new7.89 KB

Same patch, but with a <p> tag around the help text.

fago’s picture

Title: Port pageroute to Drupal 5 » Port pageroute to Drupal 5 & improve the API
Status: Reviewed & tested by the community » Active

thanks, committed.

In the meanwhile I've "ported" the pageroute subforms module to 5.x, better said I wrote it new for 5.x. It seems to work great.

Usage:

  $form['example_form'] = array(
    '#type' => 'subform',
    '#id' => 'form_id',
    '#arguments' => array($arg1),
  );

  //this will care for correctly submitted subforms
  $form['#submit']['pageroute_subform_submit'] = array();
..

So now we can use this to improve the pageroute API...
I think we should make the subform module an include for pageroute, that's automatically included and rewrite all page types with it, so far as possible. Perhaps we could create an API which just needs a form_id and arguments for a page type. Let's see...

fago’s picture

Status: Active » Fixed

ah I forgot totally about this one. pageroute 5.x 1.0 is already out .. :)

dries’s picture

Status: Fixed » Closed (fixed)