Try to Repuplish and Don’t Republish setting have abnormal

caratti 19 Mar, 2013
If a configure my form to “Try to Repuplish”, some itens (questions) are not saved to the database. It can occurs randomly with textarea, checkbox, radio and text. I mean, without an apparent reason, some itens or questions are not saved but questions before and after are saved.

If a just switch from “Try to Repuplish” to “Don’t Republish” all the data are saved to the database. But, if I try to retrieve the data to my form, some questions are not showed in the page. I mean, I can see the data saved on the database but it is not showed on the form.

I am using Joomla 1.5 and the last download of Chrono Forms for that version.
My survey (form) use Multi Page Plugin.
I checked the field names on the form and database and everything correspond.

I would like to know of someone have an advise about this issue.
GreyHead 19 Mar, 2013
Hi caratti,

Sorry, no obvious suggestions, and there is no particular connection between republishing and saving :-(

Please drag a Debugger action into the On Submit event, then submit the form and post the debug results here.

Note: if you are using the Easy Wizard you can turn on Debug on the Others tab.

Bob
caratti 19 Mar, 2013
I agree with you that, in theory, there is no connection between "Try to Repuplish", "Don’t Republish" and database table persistence.
But something happens when I switch this parameter and the behaviour of my form (Multi Page).
See item [Q16_20_OUTRAS_QUAIS] => TESTE 16 OUTRAS below.


Ok Thanks. Let me show you

1.	Form passed first SPAM check OK
2.	Form passed the submissions limit (if enabled) OK
3.	Form passed the Image verification (if enabled) OK
4.	Form passed the server side validation (if enabled) OK
5.	$_POST Array: Array ( 
  [cf_id] => 8 
  [localizador] => 1533026-5 
  [nome_pesquisador] => TESTE SINE-1533026-5 
  [data_levantamento] => 
  [nome_posto] => SINE TUCURUI/PA 
  [codigo_posto] => 1533026-5 
  [endereco_posto] => RUA JACINTO RAMOS-412 
  [localizado_endereco_registrado] => s 
  [comentario_endereco_posto] => TESTE (RESPOSTA ANTERIOR SIM) 
  [telefone_posto] => 12345678
  [cidade_posto] => Tucurui (ESTADO E PRIVADA)
  [uf_posto] => PA
  [convenio_estado] => 1
  [convenio_privado] => 1
  [nome_entrevistado] => TESTE ENTREVISTADO UM
  [email_entrevistado] => TESTE.ENTREVISTADO.UM@GMAIL.COM
  [cargo_entrevistado] => CARGO ENTREVISTADO UM
  [tempo_cargo_ano] => 1
  [tempo_cargo_meses] => 1
  [nome_demais_entrevistados_01] => TESTE UM
  [email_demais_entrevistados_01] => TESTE.UM@GMAIL.COM
  [nome_demais_entrevistados_02] => TESTE DOIS
  [email_demais_entrevistados_02] => TESTE.DOIS@GMAIL.COM
  [nome_demais_entrevistados_03] => TESTE TRÊS
  [email_demais_entrevistados_03] => TESTE.TRES@GMAIL.COM
  [nome_demais_entrevistados_04] => TESTE QUATRO
  [email_demais_entrevistados_04] => TESTE.QUATRO@GMAIL.COM
  [gravar] => Gravar e ir para o próximo bloco
  [16c9dbc7a3f9fd6d0bca9f2184444113] => 1
  [1cf1] => 25ba3f1b29a7b2c3ceb1f5f473cad3be
  [chronoformname] => MTE_ANX_03
  [Q16_01] => 1
  [Q16_03] => 1
  [Q16_05] => 1
  [Q16_07] => 1
  [Q16_09] => 1
  [Q16_11] => 1
  [Q16_13] => 1
  [Q16_16] => 1
  [Q16_18] => 1
  [Q16_20] => 1
  [Q16_20_OUTRAS_QUAIS] => TESTE 16 OUTRAS - QUAIS
  [cfformstep] => ) 
6.	$_FILES Array: Array ( ) 
7.	Form passed the plugins step (if enabled) OK
8.	Debug End


For example:
The filed [Q16_20_OUTRAS_QUAIS] has TESTE 16 OUTRAS – QUAIS value. This content is not saved to database.

if I update this field via UPDATE SQL COMMAND, my form shows it.
If a switch my form parameter to "Try to Republish" the value is saved to database. But my form does not show it.

Here is my database table structure

CREATE TABLE `jos_chronoforms_MTE_ANEXO_03` (
  `cf_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `localizador` varchar(20) NOT NULL DEFAULT '',
  `uid` varchar(60) DEFAULT NULL,
  `recordtime` varchar(100) DEFAULT NULL,
  `ipaddress` varchar(30) DEFAULT NULL,
  `cf_user_id` varchar(30) DEFAULT NULL,
  `nome_pesquisador` varchar(80) NOT NULL DEFAULT '',
  `data_levantamento` varchar(15) NOT NULL DEFAULT '',
  `nome_posto` varchar(80) NOT NULL DEFAULT '',
  `codigo_posto` varchar(20) DEFAULT NULL,
  `endereco_posto` varchar(120) DEFAULT NULL,
  `localizado_endereco_registrado` char(1) DEFAULT NULL,
  `comentario_endereco_posto` varchar(255) DEFAULT NULL,
  `telefone_posto` varchar(40) DEFAULT '',
  `uf_posto` char(2) DEFAULT NULL,
  `convenio_estado` int(2) DEFAULT NULL,
  `convenio_municipio` int(2) DEFAULT NULL,
  `convenio_privado` int(1) DEFAULT NULL,
  `cidade_posto` varchar(60) DEFAULT NULL,
  `nome_entrevistado` varchar(80) NOT NULL DEFAULT '',
  `email_entrevistado` varchar(80) DEFAULT NULL,
  `cargo_entrevistado` varchar(50) DEFAULT NULL,
  `tempo_cargo_ano` int(2) DEFAULT '0',
  `tempo_cargo_meses` int(2) DEFAULT '0',
  `nome_demais_entrevistados_01` varchar(80) DEFAULT NULL,
  `email_demais_entrevistados_01` varchar(80) DEFAULT NULL,
  `nome_demais_entrevistados_02` varchar(80) DEFAULT NULL,
  `email_demais_entrevistados_02` varchar(80) DEFAULT NULL,
  `nome_demais_entrevistados_03` varchar(80) DEFAULT NULL,
  `email_demais_entrevistados_03` varchar(80) DEFAULT NULL,
  `nome_demais_entrevistados_04` varchar(80) DEFAULT NULL,
  `email_demais_entrevistados_04` varchar(80) DEFAULT NULL,
  `Q16_01` int(2) DEFAULT '0',
  `Q16_02` int(2) DEFAULT '0',
  `Q16_03` int(2) DEFAULT '0',
  `Q16_04` int(2) DEFAULT '0',
  `Q16_05` int(2) DEFAULT '0',
  `Q16_06` int(2) DEFAULT '0',
  `Q16_07` int(2) DEFAULT '0',
  `Q16_08` int(2) DEFAULT '0',
  `Q16_09` int(2) DEFAULT '0',
  `Q16_10` int(2) DEFAULT '0',
  `Q16_11` int(2) DEFAULT '0',
  `Q16_12` int(2) DEFAULT '0',
  `Q16_13` int(2) DEFAULT '0',
  `Q16_14` int(2) DEFAULT '0',
  `Q16_15` int(2) DEFAULT '0',
  `Q16_16` int(2) DEFAULT '0',
  `Q16_17` int(2) DEFAULT '0',
  `Q16_18` int(2) DEFAULT '0',
  `Q16_19` int(2) DEFAULT '0',
  `Q16_20` int(2) DEFAULT '0',
  `Q16_20_OUTRAS_QUAIS` varchar(255) NOT NULL DEFAULT '.',
  `Q17` char(1) DEFAULT NULL,
.
.
.
.
 
 `Q60` varchar(255) DEFAULT NULL,
  `Q61` varchar(255) DEFAULT NULL,
  `Q62` varchar(255) DEFAULT NULL,
  `Q63` char(1) DEFAULT NULL,
  `Q63_OBSERVACAO` varchar(255) DEFAULT NULL,
  `Q64_AREA_IMOVEL` decimal(7,2) DEFAULT NULL,
  `Q64_TIPO_MEDIDA` char(1) DEFAULT NULL,
  `Q64_OBSERVACAO` varchar(255) DEFAULT NULL,
  `Q65_inicioH` int(3) DEFAULT '0',
  `Q65_inicioM` int(3) DEFAULT '0',
  `Q65_encerramentoH` int(3) DEFAULT '0',
  `Q65_encerramentoM` int(3) DEFAULT '0',
  `Q65_observacao` varchar(255) DEFAULT NULL,
  `Q66_tempo_atividade_anos` int(3) DEFAULT '0',
  `Q66_tempo_atividade_meses` int(2) DEFAULT '0',
  `Q66_observacao` varchar(255) DEFAULT '',
  PRIMARY KEY (`cf_id`),
  KEY `idx_localizador` (`localizador`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
GreyHead 20 Mar, 2013
Hi caratti,

I can only guess that this is a problem with the multi-page plug-in in CFv3. Without digging into the code I don't know what might cause it though :-(

If you turn on Site Debug so that you can see the MySQL queries does that offer any clues?

Bob
caratti 20 Mar, 2013
Ok.

I do not know what I can do now.

The information presented by the DEBUG option does not help me in a accurated diagnosis. I mean, all the information is there as expected.

I checked several times the correspondence of the filed names in the table and and form. Everything is ok. There is no difference. I used the copy and paste method to be sure.

There is no reason, for example, the code below works and its subsequent does not.


<!-- Q17 This Works very well -->
    <div class="form_item">
        <P>
            <b><i>17. O(A) senhor(a) preencheu a tabela com as informações sobre os funcionários do Posto?</i></b>
        </P>

        <div class="form_element cf_radiobutton">
            <div class="float_left">

                <input value="s" title="" class="radio" id="Q17_S" name="Q17" type="radio"  onclick="EscondeElemento('Q17_NAO','Q17_N');"  <?php echo ($row->Q17 == 's' ) ? 'CHECKED' : ''; ?> />
                <label for="Q17_S" class="radio_label">Sim</label>
                <br />
                <input value="n" title="" class="radio" id="Q17_N" name="Q17" type="radio" onclick="MostraElemento('Q17_NAO','Q17_N'); " <?php echo ($row->Q17 == 'n' ) ? 'CHECKED' : ''; ?> />
                <label for="Q17_S" class="radio_label">Não</label>
                <br />

                <div id="Q17_NAO" style="display:<?php echo ($row->Q17 == 'n') ? 'block' : 'none'; ?>;" >
                    <fieldset class="myfieldset" >
                        <legend class="mylegend" ></legend>

                        <div class="form_item">
                            <div class="form_element cf_checkbox">
                                <P>
                                    <i>Descrever</i>
                                </P>
                                <div class="float_left">
                                    <textarea class="cf_inputbox" rows="5" id="Q17_DESCREVER"  cols="90" name="Q17_DESCREVER" ><?php echo $row->Q17_DESCREVER; ?></textarea>
                                </div>
                            </div>
                            <div class="cfclear"> </div>
                        </div>
                    </fieldset>
                </div>
                <br />
            </div>
        </div>
        <div class="cfclear"> </div>
    </div>






<!-- Q21 This does not work -->
    <div class="form_item">
        <P>
            <b><i>21. Existem materiais (manuais, guias, normas, etc.) que orientem os funcionários para um melhor atendimento de trabalhadores e empregadores? (Materiais que informem sobre as ações do Programa Seguro-Desemprego, sobre a integração de seus componentes, sobre a realidade do mercado de trabalho ou sobre como realizar um bom atendimento) Como são estes materiais e de que forma eles são passados aos funcionários? (perguntar e observar solicitando para ver alguns destes materiais e anotando eventuais observações necessárias) </i></b>
        </P>

        <div class="form_element cf_radiobutton">
            <div class="float_left">

                <input value="s" title="" class="radio" id="Q21_S" name="Q21" type="radio" onclick="MostraElemento('Q21_SIM','Q21_S'); " <?php echo ($row->Q21 == 's' ) ? 'CHECKED' : ''; ?> />
                <label for="Q21_S" class="radio_label">Sim</label>

                <div id="Q21_SIM" style="display:<?php echo ($row->Q21 == 's') ? 'block' : 'none'; ?>;" >
                    <fieldset class="myfieldset" >
                        <legend class="mylegend" ></legend>

                        <div class="form_item">
                            <div class="form_element cf_checkbox">
                                <P>
                                    <i>Descrever</i>
                                </P>
                                <div class="float_left">
                                    <textarea class="cf_inputbox" rows="5" id="Q21_DESCREVER"  cols="90" name="Q21_DESCREVER" ><?php echo $row->Q21_DESCREVER; ?></textarea>
                                </div>
                            </div>
                            <div class="cfclear"> </div>
                        </div>
                    </fieldset>
                </div>
                <br/>

                <input value="n" title="" class="radio" id="Q21_N" name="Q21" type="radio"  onclick="EscondeElemento('Q21_SIM','Q21_S');"  <?php echo ($row->Q21 == 'n' ) ? 'CHECKED' : ''; ?> />
                <label for="Q21_S" class="radio_label">Não</label>

            </div>
        </div>
        <div class="cfclear"> </div>
    </div>



Important: Just the Q21_DESCREVER field information is not saved.

// Javascript functions code used

// Enable Element
function MostraElemento(id, idFoco) {  
    document.getElementById(id).style.display = 'block';
    document.getElementById(idFoco).focus();
}

// Disable Element
function EscondeElemento(id, idFoco) {
    document.getElementById(id).style.display = 'none';
}



More information

Form configuration:
1) Republish fields if error occurred: Don't Republish
2) Form method: Post
3) Enable Data storage: Yes
4) Saving Data/Emails order: After Email
5) Enable Validation: Yes
6) Enable Server Side Validation


Table name: jos_chronoforms_MTE_ANEXO_03

Part of database table structure:

`Q16_20_OUTRAS_QUAIS` varchar(255) DEFAULT NULL,
`Q17` char(1) DEFAULT NULL,
`Q17_DESCREVER` varchar(255) DEFAULT NULL,
`Q18` char(1) DEFAULT NULL,
`Q18_DESCREVER` varchar(255) DEFAULT NULL,
`Q19_00` int(3) DEFAULT '0',
`Q19_01_recepcao` int(3) DEFAULT '0',
`Q19_02_seguranca` int(3) DEFAULT '0',
`Q19_03_limpeza` int(3) DEFAULT '0',
`Q19_04_manutencao` int(3) DEFAULT '0',
`Q19_05_outras` int(3) DEFAULT '0',
`Q20` int(1) DEFAULT '0',
`Q21` char(1) DEFAULT NULL,
`Q21_DESCREVER` varchar(255) DEFAULT NULL,
`Q22` char(1) DEFAULT NULL,

ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;


Joomla version: 1.5.22


Thanks for the attention
Ricardo Caratti.
GreyHead 20 Mar, 2013
Hi caratti,

I don't see anything obvious in the code you posted that would stop the data from saving. Probably the only way id to check step by step what data is being passed on and exactly where the failure takes place :-(

My first step would probably be to check with the browser web developer tools to make sure that the values were (a) in the HTML and (b) in the POST array when the form is submitted.

Bob
Max_admin 24 Mar, 2013
Hi,

The republish feature in V3 was not well done, and I'm afraid that even if we find the problem, it may not be easy to fix it, so I suggest that you use CFV4 instead.

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.