google-code-export / digitalus-cms

Automatically exported from code.google.com/p/digitalus-cms
1 stars 1 forks source link

adding multiple modules to a single page have a problem in saving the data #166

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. and this to your layout file   <div id='news2' class="module">
                            <digitalusControl type='moduleSelector' id='modulesearch' group='news' />
                     </div>
                     <div id='news' class="module">
                            <digitalusControl type='moduleSelector' id='modulenews' group='news' />
2. go to the admin side and fill the values for modulenews and modulesearch
3. hit the submit button

What is the expected output? What do you see instead?
to save the data in the database but the data will(i.e. about the modules) not 
be saved 

What version of the product are you using? On what operating system?
r780 on ubuntu 10.04

Please provide any additional information below.
i think the posted value will not be matched correctly to the forminstance 
during posting the value form->isvalid($_POST) the values for the modulenews 
and modulesearch will be null but if i add the respective values in the 
database for modulenews and modulesearch as an xml of value

<?xml version="1.0"?>
<elementData><modulesearch>search_search</modulesearch><modulenews>login_index</
modulenews><module>blog_blog</module><blog>41</blog></elementData>

and try to load that page it works perfectly ..

Original issue reported on code.google.com by jspe...@gmail.com on 27 Dec 2010 at 5:47

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
in addition to this i cannot have a two modules of the same type with different 
id's 
if i have two blog modules of attribute <blog>41</blog> and <blog>47</blog> one 
of two will overwrite each others value making it appear i if i select two of 
the same type 

Original comment by jspe...@gmail.com on 5 Jan 2011 at 7:43

GoogleCodeExporter commented 9 years ago
when i tired to debug PageController.php on the editAction () {      
        if ($this->_request->isPost() && $form->isValid($_POST)) {
            $values = $form->getValues();

i saw that it is a must to have one digitalusControl tag like this

   '<digitalusControl type='moduleSelector' id='module' group='news' />' 

so that the other modules will be passed as an array of 
        module[ id's of the other modules ]
but this will have a serious problem 
1. for modules having addtional attributes like 'mod_blog' 
2. loading values for modules selectors from the database also will have a 
problem because this file will load it incorrectly (load-module.phtml) but it 
will work only for this one  
 '<digitalusControl type='moduleSelector' id='module' group='news' />' 

Original comment by jspe...@gmail.com on 5 Jan 2011 at 7:59

GoogleCodeExporter commented 9 years ago
Fixed with r782!
Please note that in module's *.form.phtml files the "belomgsTo" attribute has 
to be changed from the value "module" to $this->getData('element',  
$this->data->get)

Original comment by lowtower1974@gmail.com on 9 Jan 2011 at 1:55