-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…k to the 'und' language code if the entity's language code doesn't exist on the field(s).
- Loading branch information
1 parent
c4a7f6e
commit 2306255
Showing
1 changed file
with
14 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2306255
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @signalpoint,
I'm sorry to reopen this, but I think the fix above should be applied also to the
drupalgap_entity_add_core_fields_to_form
function, otherwise all values in the form (when the field language is "und" while the entity one is something else) show empty.Will try myself meanwhile.
HTH
2306255
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pierpa68 Yes please try adding these changes to
drupalgap_entity_add_core_fields_to_form
on your local copy, and let me know if that works. I have a hard time testing/debugging multi-lingual sites, because my clients never need them :(2306255
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@signalpoint I've fond an older version of the
field.js
module that seems to already include the fix above... Unfortunately I'm unable to find the commit number in github. Here it is a snippet. I can't understand why it was changedCurrent version in github:
The older version seems to work atm.
HTH
2306255
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pierpa68 Thank you for clarifying, I believe I just resolved this via #503.
2306255
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@signalpoint Thanks for comment.
Your commit almost solved the problem: I had to move line n.130
if (!form.elements[name][language]) { form.elements[name][language] = {};
after you set the language to 'und' at line `143-146 of field.js, otherwise at the line
form.elements[name][language][delta] = { value: default_value };
returns an error.
By the way, trying to merge my work with your recent commits, I was unable to run my application due to an error in
drupalgap_init()
: it seems thatDrupal.cache_expiration
is undefined and I can't find where it should be declared.2306255
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pierpa68 Grab the latest
jdrupal.min.js
for the fix to the missingDrupal.cache_expiration
.2306255
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pierpa68 I moved the creation of the element after the determination of the language code as you suggested, thanks!
2306255
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@signalpoint I found that a similar approach has to be applied in other procedures as well in order to make an entity editable without errors in case of different language.
I'll send you a pull shortly, of you like.
2306255
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pierpa68 That would be great, thank you.
2306255
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@signalpoint Already done. I'm sorry but I messed the pull a bit sending patches for 2 different issues (#751).
One is just the updated locale file for italian language.
2306255
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@signalpoint I'm still having issues with language, this time adding new node.
Maybe a ultimate solution would be to use the
translatable
element of thefield_info_field
structure as returned by the functiondrupalgap_field_info_field(name)
.Documentation here seems to suggest so.
If you think it could be correct I can try to make some of the necessary modification to the code.
2306255
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi i have problems with this code,i update latest version and still no working, i change with two languages, and with und working body field, when i editing the node in drupalgap,int the body field no appear the editing text, but in the site yes, appear text, thanks with any update,thanks @pierpa68 @signalpoint
2306255
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
send code with the array
[ { vid: '26', uid: '1', title: 'GczHhh', log: '', status: '1', comment: '1', promote: '0', sticky: '0', vuuid: '49c237f8-1a42-402f-a651-ff803fd152d8', nid: '26', type: 'notas', language: 'es', created: '1459811105', changed: '1459875470', tnid: '0', translate: '0', uuid: '1c13e0ca-e259-4501-aa17-a2332bb71a78', revision_timestamp: '1459875470', revision_uid: '1', body: [Object],
2306255
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jomarocas you're right, there are already some issues in the actual version. But I've gone further and the code I'm testing here seems to work correctly now.
I hope to make a commit shortly, if @signalpoint agrees
2306255
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pierpa68 I'm definitely open for pull requests that fix these multi lingual issues, thank you!