Re: Problem with saveAll translations within one form - CakePHP multilingual website

2012-12-10 Thread maurozadu
I have the same problem, did you came up with a solution?

Thank you!

El lunes, 23 de enero de 2012 16:05:43 UTC-3, Anna P escribió:
>
> Hello. 
>
> I'm making multilingual website and I want administrator to add and 
> edit subpage in all available languages within one form. 
>
> The add function works fine, the problem is when I want to edit 
> subpage and all translations at one time - one of the fields does not 
> want to update in i18n table. 
>
> Model: 
> http://pastebin.com/Mas1aciu 
>
> add function (works fine, adds record to "subpages" table and records 
> to "i18n" table containing title, link and content in every language): 
> http://pastebin.com/N61WLwNQ 
>
> add view: 
> http://pastebin.com/Y6a1WquA 
>
> edit function: 
> http://pastebin.com/1ZdumqUe 
>
> edit view: 
> http://pastebin.com/BWcXvGKY 
>
> Editing title and content and saving form changes only the 
> translations of fields "link" and "content" in i18n table. The title 
> just won't change at all in translations table, after editing a form. 
>
> I've just build another model - Category. Same issue here, although I 
> translate only two fields (name and link, based on the name). The same 
> situation with editing - only "link" translation is being updated, and 
> "name" isn't. 
>
> Anyone has a clue? Or maybe there is some better solution to create 
> and update dynamic translations with the use of one form? 
>
> Regards, 
> Anna

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: CakeFest IV - America - Help us pick a location!

2009-11-27 Thread maurozadu
Montreal?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


form helper issue for associated models inside and outside a plugin

2009-07-23 Thread maurozadu

We have a plugin (let’s name it “Cms”). This plugin has a model called
Image, used to add images to a model. The Image model is inside the
plugin; others models are, of course, outside (for example the “Page”
model). The relationship is made on the fly, with a code like this

$this->Page->bindModel(array('hasMany' => array('Cms.Image' => array
('foreignKey' => 'record_id';

We use Cms.Image because the bind must be donde like: Plugin.Model

Then we want to add a new page, so we write this code in the “add”
view

echo $form->create(array('type' => 'file'));
echo $form->input('Page.title');
echo $form->input('Page.content');
...etc

And now, here is the problem: ¿How do we write the input for the
Image?

If the Image model where outside the plugin, we would normally use:

echo $form->input('Image.0.name');

then in the controller we use the method saveAll, and everything is
smooth.

But the situation is different here, we have a model outside the
plugin (Page) which is associated with a model Inside the plugin
(Image)

My first attempt was to do this:

echo $form->input('Cms.Image.0.name');

but it fails! It generates an input with the attribute name="data[Cms]
[Image][0][name]"

If I hardcode the input field with something like name="data[Cms.Image]
[0][name]" everything works perfect (with validation and callbacks for
both models). But working in this way I have to do an extra job for
display error messages and I assume I would have some other issues if
I don’t use the form helper.

The second idea was:

echo $form->input('Image.0.name', array('plugin' => 'Cms'));

But it didn’t work either, because the input method in the form helper
doesn’t expect a plugin key in the options array and just ignore it. I
read the code of Form::input() and I found that the separation into
array keys by the point is made by a very parent classes, so I neither
could easily hack the core to find a solution.

What do yo think? Is there a way to solve this issue or the problem is
me misunderstanding something? (or everything maybe)

Thanks for the support!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---