Comments

socialnicheguru’s picture

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

socialnicheguru’s picture

# 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.

socialnicheguru’s picture

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

That file is not included in the distribution of content_profile

socialnicheguru’s picture

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).

socialnicheguru’s picture

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 {

sepgil’s picture

Assigned: Unassigned » sepgil
StatusFileSize
new10.84 KB

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

cerup’s picture

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?

sepgil’s picture

StatusFileSize
new5.95 KB

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...

fago’s picture

Category: support » 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.

sepgil’s picture

Status: Needs work » Needs review
StatusFileSize
new5.53 KB

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

davej’s picture

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

davej’s picture

Status: Needs work » Needs review

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

Dave

davej’s picture

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:

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

sepgil’s picture

StatusFileSize
new5.75 KB

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.

davej’s picture

@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

davej’s picture

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

fago’s picture

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.

fago’s picture

Status: Needs review » Needs work
fago’s picture

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

sepgil’s picture

StatusFileSize
new5.82 KB

fixed all Issues mentioned by fago

BleuBiRTH’s picture

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.

davej’s picture

@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

Bilmar’s picture

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

adpo’s picture

I cannot apply contentprofile_pageroute_005.diff patch because of the following error: Could not open the file \dev\null

fago’s picture

Status: Needs work » Fixed

Hm, the theme function definition in hook_theme() wasn't updated and missed the include file. Also correcty coding style (indention) of ContentProfilePageEditProfile::getform(). To move on I corrected this and committed the patch.

Please test whether the version in CVS is working right now and reopen if not.

tim.plunkett’s picture

Status: Fixed » Needs review

WSOD after updating:

Fatal error: Class 'PageroutePageEdit' not found in sites/all/modules/DRUPAL-6--1/content_profile-DRUPAL-6--1/content_profile.pageroute.inc on line 23

rbrandon’s picture

Priority: Normal » Critical
Status: Needs review » Needs work

You are recieving this error because the pageroute module is not enabled in your install. Content Profile needs to add the dependency to pageroute and assure that the update path works. I had this same issue.

--Richard

Mark_Watson27’s picture

I added a check to see if the pageroute module existe to the content_profile.pageroute.inc file, i.e.

if (module_exists('pageroute')) {
  include_once(drupal_get_path('module', 'pageroute') . '/pageroute.page_edit.inc');
  include_once(drupal_get_path('module', 'pageroute') . '/pageroute.page_view.inc');

  /**
   * ContentProfilePageEditProfile displays a form that allows users to edit content profiles.
   */
  class ContentProfilePageEditProfile extends PageroutePageEdit {
.
.
.
.
.
    public static function info() {
      return array('name' => t('Content profile display'));
    }
  }
}
sepgil’s picture

I think the check would fit better in the function content_profile_theme().
I made a new patch for the issue.

fago’s picture

Status: Needs work » Fixed

Ops, the theme registry includes the file during rebuild. Thanks for the quick fix, committed. Of course with module_exists() instead of $module_exists ;)

Status: Fixed » Closed (fixed)

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