Needs review
Project:
Content Profile
Version:
6.x-1.x-dev
Component:
Base module
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
13 May 2009 at 09:54 UTC
Updated:
25 Jan 2013 at 12:23 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
waddles commentedThere is a bug in content_profile.module:content_profile_load() that I haven't quite worked out yet. I will post again soon with a fix.
Comment #2
waddles commentedComment #3
waddles commentedComment #4
waddles commentedComment #5
dddave commentedChanging status
Comment #6
socialnicheguru commentedhi, the link for the file does nto link to anything.
Chris
Comment #7
dddave commented@ wad
Please attach the correct files.
Comment #8
waddles commentedSorry for the bad posts. I was getting disconnected from d.o. due to too many mysql connections.
This is only a partial fix that will stop the behaviour mentioned by the o.p. The real fix should allow several content_profile content items to be valid depending on what language they are viewed in. For example, I should be able to create a profile in Spanish and English with a fallback to the site's default language (English) if there is no Spanish profile created yet. I think the real bug there is that cp content is not being saved with a language but I could be wrong.
Comment #9
dddave commentedComment #10
fago>I think the real bug there is that cp content is not being saved with a language but I could be wrong.
Content profile doesn't change the usual node-behaviour here, so this should work fine.
As of now, the profile is displayed in the currently activated language on the user page. I'm not sure if it should fall-back to the default language, if there is no profile in the current one. If you think so, roll a patch..
However content_profile_load() should always work right, with the above patch it would return the wrong language profile afterwards even if the language is specified explicitly.
Comment #11
ShutterFreak commentedGood point.
I do not know which module should be in charge of selecting the appropriate language version of multilingual content. Each language version is a separate nid. IIRC there's a distinct table keeping track of which nids link to the same "meta node".
Maybe it's just a matter of implementing one or more i18n hooks in the content_profile module?
Comment #12
waddles commented@fago: there is definitely a problem with translation handling. I will try to explain the situation without the above patch.
In a test site, I have these content items and users, where
/admin/settings/language/configureI have Language negotiation: Path prefix with language fallback/admin/settings/language/i18n/configureI have Content selection mode: Current language and language neutral.When I visit
/users/test1, I see the Test 1 User node contentWhen I visit
/users/test2, I see the default (system) profile content with a link to 'Create the user's Profile.'When I visit
/es/users/test1, I see the default (system) profile content with a link to 'Create the user's Profile.' Same applies for test2.As test1 user (UID=3), when I visit
/es/user/3/edit/profile, I get a new form to create a new profile. If I change the node's language to Spanish and save it I get a new node. Switching languages shows the relevant content from each node correctly. However, I do not see a link to Translate the node I am editing in either language.As test2 user (UID=4), when I visit
/es/user/4/edit/profile, I get a new form to create a new profile. If I leave the node's language as 'Language neutral' and save it, it throws the error:This user has already a content profile of this type. You can only create one profile per user.The message should say "You can only create one profile per user per language" which is kinda confusing.Using the above patch, I at least get 'Language neutral' content to display but there is more to be done for correct handling.
Comment #13
asak commentedsubscribing.
Comment #14
yesct commentedsub
Comment #15
Shai commentedsubscribing
Comment #16
jolidog commentedAlso interested in a solution... Subscribing.
Comment #17
mairav commentedSusbcribing. Any idea when will you be able to apply something to a release?
Comment #18
arhak commentedanother related issue #368510: Translate node types
if you only need to fix the title translation you have two choices (exclusive, just one or the other)
368510#comment-2061346
368510#comment-2061360
Comment #19
blueblade commentedSusbcribing
Comment #20
mairav commentedI think if a node type has been checked to be a content profile, it shouldn't be shown under "Create content". It should only appear in the edition of "My account".
And, if the site has translations enabled, and the user the permissions to translate, In that tab inside my account, the user should be able to translate the content profile.
In node limit number (#586064-22: Node Limit Number for Drupal 6 - FEATURES REQUEST) @jdwfly gave me a code for another thing, that allows to check if the new node is a translation, maybe that can be used here:
Comment #21
mairav commentedI'm using the new node limit number module for drupal 6 and created a rule saying that a user can create one node of content profile unless the new node it's a translation, and it worked.
So, it should only be necessary to remove the option to create a node type under "create content" and to create a translate link in the Account. So, after the user has a profile created, he can translate it. Is there any way you can include this?
And of course, in the profile page, when I change language, the content should be shown according to the language, as now is not doing that. It always shows the original node.
Comment #22
dasjoin my case, when viewing a a user page, content_profile_load is called, $lang isn't set.
so adding a language-retrieval and a fallback, if language isn't available works as a quickfix.
though, it would be interesting, why the $lang variable isn't set...
Comment #23
finex commentedDoes exist a solution of this problem? I'm having this problem and I really need to find a solution: my users need to have a translatable content profile but they cannot :-(
Comment #24
hnln commentedDon't know if this is brought up somewhere else, but also the panels integration of node_profile should be adjusted to allow for translated profiles.
I noticed in node_from_user.inc, in the function "content_profile_node_from_user_ctools_context" content_profile_load($conf['type'], $uid) (line 39) is called without $lang argument. Would adding in the active language there correctly call the translated profile ?
Tnx,
HnLn
Comment #25
idflood commentedSubscribing
Comment #26
spacereactor commentedSubscribing
Comment #27
Anonymous (not verified) commentedWhen using direct path to access profil node with nid (node/%nid/edit) translation link display well.
Then I want to translate this node by using this translation link : be sure to give user create {node type for this profik} create permission !
I create a node, save it but there is something wrong : node is well created but it is not considered as the previous node translation.
Last try : I've hard created a translation for this profile node using core Drupal functions : edit profile node > translate, select a third language (not the second that previously failed) and so on. New node is created and well considered as a translation from the original profil node.
There is something wrong with node api (content_profile_nodeapi ?)...
Comment #28
Anonymous (not verified) commentedStill active in current version.
Comment #29
ShutterFreak commented@Domsou What do you mean with "There's something wrong with node api (content_profile_nodeapi)" ? Are you seeing a PHP crash?
Comment #30
Anonymous (not verified) commented@ShutterFreak
No, no PHP crash.
Comment #31
bohz commented#22 works well for me using 6.x-1.0, thanks!
As a bonus, if you enable the option "Switch interface for translating" at
admin/settings/language/i18n, when editing the content profile from within the user account the user can now translate the node simply switching the whole site language.Comment #32
Anonymous (not verified) commentedsubscribing. I tried #22 but nothing changed. Still can't translate the node. it only shows up in the language I created it with. Can't create a second uprofile node in a different language and I really don't want to install any more modules because my memory isn't high enough for that.
Comment #33
heyehren commentedDoes anybody know how to get this working? I think it is quite an important feature, and it seems that there is a common interest as well.
We use the user profiles and content profiles for a directory type of website, where we control which content goes on the website. This way we are not bombarded with lots of user content, that fills up the "..to translate" cue.
It would be great to have the option to translate the user profile content if required.
Comment #34
hanskuiters commented+1
Comment #35
majdi commented#22 Works perfect for me
Comment #36
skat commentedSorry, how did you implement #22? in which file must I add that code?
thank you!
Comment #37
dasjo#22 is a replacement function for content_profile_load in content_profile.module
http://drupalcontrib.org/api/drupal/contributions--content_profile--cont...
it would be easier if it was provided as a patch, so feel free to create one
Comment #38
skat commentedok, thank you
Comment #39
claudiu.cristeaComment #40
claudiu.cristeaHere's a patch that works for me.
Comment #41
claudiu.cristeaTrailing spaces cleanup.
Comment #42
claudiu.cristeaPrevent a case when having more than 1 node with the same UID, type and default language.