Pageroute Integration

Tauran - November 14, 2008 - 14:14
Project:Content Profile
Version:6.x-1.x-dev
Component:Base module
Category:task
Priority:normal
Assigned:sgilits
Status:needs work
Description

Pagetypes for contentprofile integration in pageroute.

AttachmentSize
content_profile_6.x_pageroute-1.patch5.34 KB

#1

SocialNicheGuru - April 21, 2009 - 07:41

what is this used for?

did it make it in?

I am having trouble with pageroute and content profile and I am not sure if this might handle it.

I can create a route and assign it to a node type that I specified as a content profile but the content profile.

if i go back and used pageroute wizard to edit the content profile, none of my information is filled in.

i can go all the way, click submit, and I am given the error that a content profile already exists for this user.

Does your patch address this issue?

Thanks,
Chris

#2

SocialNicheGuru - April 21, 2009 - 16:30

# warning: include_once(sites/all/modules/content_profile/content_profile.pageroute.inc) [function.include-once]: failed to open stream: No such file or directory in /sites/all/modules/pageroute/pageroute.module on line 694.
# warning: include_once() [function.include]: Failed opening 'sites/all/modules/content_profile/content_profile.pageroute.inc' for inclusion (include_path='.:/Applications/MAMP/bin/php5/lib/php') in /sites/all/modules/pageroute/pageroute.module on line 694.
# warning: call_user_func(content_profile_page_view_profile::info) [function.call-user-func]: First argument is expected to be a valid callback in /sites/all/modules/pageroute/pageroute.module on line 376.

#3

SocialNicheGuru - May 4, 2009 - 23:12

the patch did not create a content_profile.pageroute.inc file.

That file is not included in the distribution of content_profile

#4

SocialNicheGuru - May 4, 2009 - 23:23

This still does not seem to work

I created a content profile

used pageroute to go back to the content profile to end

none of my data is shown

when I fill it in again, i get an error "this user already has a node of this type" (paraphrasing).

#5

SocialNicheGuru - May 6, 2009 - 18:52

i had to

1. recreate my pageroute because now there is a content profile option which was not there pre-patch
2. I get differenent errors now

# warning: pageroute_page::include_once(sites/all/modules/content_profile/content_profile.page_edit_profile.inc) [pageroute-page.include-once]: failed to open stream: No such file or directory in /drupal/sites/all/modules/pageroute/pageroute.page.inc on line 62.
# warning: pageroute_page::include_once() [function.include]: Failed opening 'sites/all/modules/content_profile/content_profile.page_edit_profile.inc' for inclusion (include_path='.:/Applications/MAMP/bin/php5/lib/php:') in /drupal/sites/all/modules/pageroute/pageroute.page.inc on line 62.

content_profile.page_edit_profile.inc is not included however in a file. instead it is a class:

content_profile.pageroute.inc:17:class content_profile_page_edit_profile extends pageroute_page_edit {

#6

sgilits - August 26, 2009 - 13:19
Assigned to:Anonymous» sgilits

I made new patch that works with the newest dev version of pageroute.

AttachmentSize
contentprofile_pageroute_001.diff 10.84 KB

#7

cerup - August 29, 2009 - 03:42

sgilits: I can't figure out how to apply your diff. It doesn't seem to be patching correctly for me as it's creating duplicate references and causing errors. Am I correct in applying this to the pageroute module and not content type? Do I also need the patch at the top too?

#8

sgilits - September 14, 2009 - 10:41

Yes, You have to apply the diff on to the pageroute module. Are you using the latest version from the cvs repository(branch DRUPAL-6--1)?
I had to make a new patch, since I made significant changes in pageroute(http://drupal.org/node/560966). I also corrected some coding issues. The new patch will not work until the my pageroute patches are commited...

AttachmentSize
contentprofile_pageroute_002.diff 5.95 KB

#9

fago - September 15, 2009 - 15:26
Category:support request» task
Status:needs review» needs work

I think a separate module is a overkill here, let's use a simple include. Best there should be just a content_profile.pageroute.inc. The @file comment should explain what it is for.

* theme_content_profile_empty() should also move in the include and should be named such that it's associated with pageroute. -> theme_content_profile_pageroute... See hook_theme() for how to specify the include there.

The hook implementations can go directly in the .module.

#10

sgilits - September 21, 2009 - 14:01
Status:needs work» needs review

Merged the to whole module into content profile, so you won't need a separate module.

AttachmentSize
contentprofile_pageroute_003.diff 5.53 KB

#11

davej - September 21, 2009 - 15:39
Status:needs review» needs work

Subscribing and willing to help if I can. I think Content Profile + Pageroute would be very useful for a project I'm currently working on, which must be completed in the next few weeks.

#8 (Sep 14th) mentions significant uncommitted changes in Pageroute. The latest dev release of Pageroute at time of writing is dated Sep 16th - does this contain the required changes? I'm just trying to get clear which versions of Pageroute and Content Profile I need to get and apply which patches to. Or if there are releases in the pipeline and I just need to be patient for a few days, that's cool; an estimate of timescale would be very helpful.

Thanks for your valuable work on these modules.

Dave

#12

davej - September 21, 2009 - 15:41
Status:needs work» needs review

Don't know how the status field got changed there, changing it back.

Dave

#13

davej - September 25, 2009 - 11:21

I grabbed the latest dev versions of Pageroute and Content Profile (both dated 2009-Sep-16) and applied patch contentprofile_pageroute_003.diff from #10. I got errors like:

call_user_func(content_profilePageeditprofile::help) [function.call-user-func]: First argument is expected to be a valid callback in .../sites/all/modules/pageroute/pageroute_ui.forms.inc on line 221

Fixed these by changing pageroute.module:

<?php
function pageroute_get_page_class($module, $type) {
 
$page_class = str_replace('_', '', $module) . 'Page' . $type;
  return
$page_class;
}
?>

And changing function pageroute_get_types to call pageroute_get_page_class to get $page_class.

I can now add pages of type Content profile display (content_profile) and Content profile editing form (content_profile) to pageroutes. Great.

However Content profile editing form (content_profile) isn't behaving as I would hope. I have two profile node types: profile1 and profile2. (Eventually I'll have six, each with different CCK fields.) I want to use Pageroute to walk the user through adding or editing all their profile nodes. This is the behaviour I currently get, when the user already has profile nodes of each node type:

With "Display submit button" enabled for each Content profile editing form (problems in italics):
(A1) Edit my profile1 node, click Forward
-> takes me to a node edit form with title Profile Part 2 (the title of my profile2 edit page) but displaying the updated content of the profile1 node and not displaying the CCK fields of either profile1 or profile2, with message "Profile Dave's Profile 1 has been updated."
(A2) Click Forward again (no further content changes)
-> takes me to an edit form with title Profile Part 2 and the content of the profile2 node, with message "This content has been modified by another user, changes cannot be saved."
(A3) Edit my profile2 node, click Forward
-> takes me to correct redirect page with message "Profile 2 Dave's Profile 2 has been updated."

With "Display submit button" disabled for each Content profile editing form (problems in italics):
(B1) Edit my profile1 node, click Forward
-> takes me to an edit form with title Profile Part 2 and the content of the profile2 node, no message, changes not saved.
(B2) Edit my profile2 node, click Forward
-> takes me to correct redirect page, no message, changes not saved.

The behaviour I would want, whether or not "Display submit button" is enabled, is:
(C1) Edit my profile1 node, click Forward
-> takes me to an edit form with title Profile Part 2 and the content of the profile2 node, with message "Profile Dave's Profile 1 has been updated."
(C2) Edit my profile2 node, click Forward
-> takes me to correct redirect page with message "Profile 2 Dave's Profile 2 has been updated."

Is the latter the intended behaviour?

Thanks,

Dave

#14

sgilits - September 28, 2009 - 11:03

Sorry that I forgot to mention that you'll need the latest patches for pageroute in the patch above....

Anyway, I corrected the issue Dave mentioned(yeah, the third example is the intended behaviour) in this new patch but you'll need the lastet patches for pageroute (especially this one http://drupal.org/node/589958#comment-2090072) or you'll have to wait until they are commited.

AttachmentSize
contentprofile_pageroute_004.diff 5.75 KB

#15

davej - September 28, 2009 - 15:02

@sgilits: thanks for confirming the intended behaviour and for the new patch. Starting from pageroute-6.x-1.x-dev 2009-Sep-16, I applied the following patches:

I then applied contentprofile_pageroute_004.diff to content_profile-6.x-1.x-dev 2009-Sep-16 . I tested both adding and editing profile nodes, both with and without the Submit button enabled and found that it all works as desired. Thank you, good work!

Dave

#16

davej - October 1, 2009 - 16:45

Just spotted that, using the versions as at #15, the normal node adding form doesn't create a node when you hit the Forward button, unless "Display submit button" is enabled. Shall I create a new issue for this?

Dave

#17

fago - October 4, 2009 - 13:12

ok, fine that it's working now.

Can we can name include .pageroute.inc so it's clearer for what module the integration is?
If the class has to be ContentProfilePageRouteEditProfile then, I think that's fine.

Please always look out for the Code-style: -> function getForm has a wrong indentation.

* content_profile_empty -> please add pageroue to the prefix, this it's clear where it belongs to. E.g. content_profile_pageroute_empty. Also you specify the include file in hook_theme.

* if ($node == NULL) {
usually we use !isset($node) to do that. but !empty($node) might be even better in that case.

#18

fago - October 4, 2009 - 13:16
Status:needs review» needs work

#19

fago - October 4, 2009 - 13:16

@#16: yep please open a separate issue in the pageroute queue.

#20

sgilits - October 7, 2009 - 11:20

fixed all Issues mentioned by fago

AttachmentSize
contentprofile_pageroute_005.diff 5.82 KB

#21

BleuBiRTH - November 11, 2009 - 11:05

First of all thanks for the hard work! @fago is or will this patch be integrated with the new dev version of content profile?

If i understand correctly you have to apply all the above patches in sequence to see the result of your work? For a newbee like me, it would be great if you could describe the sequence in wich you have to apply the patches, starting from latest official release from both modules.

#22

davej - November 11, 2009 - 13:21

@BleuBiRTH: I believe the pageroute patches that I mention at #15 have been committed and are in pageroute-6.x-1.0-beta4 and the latest dev version. Either of these should be fine, I'm using beta4 successfully.

content_profile has been updated less frequently so I've been using a patched version of content_profile-6.x-1.x-dev dated 2009-09-16.

I see there's a new dev version dated 2009-Nov-04: I've just grabbed that and I see its version of content_profile.module is dated Aug 5, so looks as though it doesn't have the above patch contentprofile_pageroute_005.diff . contentprofile_pageroute_005.diff supersedes the previous versions of the patch, you don't need to apply them all. I'd suggest using the latest dev version and applying contentprofile_pageroute_005.diff . I've just tried this, the patch applies cleanly and seems to work.

All the best,

Dave

#23

trupal218 - November 18, 2009 - 04:44

I will be trying the patch this weekend and would like to help with any testing in the future.
Thanks for the great work!

 
 

Drupal is a registered trademark of Dries Buytaert.