News:

Wondering if this will always be free?  See why free is better.

Main Menu

Logic error in Display.template.php

Started by maestrosite.ru, February 28, 2012, 06:12:27 AM

Previous topic - Next topic

maestrosite.ru

Where the Error Occurred

    File: Display.template.php
    Line: 208-209, 633-636
    Any relevant errors in the SMF error log (if so please post them)?:

Form "quickModForm" echo without check $options['display_quick_mod']

(but checkboxes and javascript handlers for this form echo only  $options['display_quick_mod'] == 1)
First of all, sorry for my english. По-русски у меня получается значительно лучше.

Проблема на форуме? Сначала посмотрите лог ошибок вашего форума и лог ошибок сайта (error_log)

You can try other modifications - see demo

emanuele

I can't find an instance of $options['display_quick_mod'] in Curve at the lines you reported.
Are you using the default theme and/or modifications?


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

maestrosite.ru

#2
Quote from: emanuele on February 28, 2012, 06:20:49 AM
I can't find an instance of $options['display_quick_mod'] in Curve at the lines you reported.
Are you using the default theme and/or modifications?

Of course, not find. In this lines print 'form'-tags. In [strike]Curve[/strike] Core analog lines: 187-188, 603-604, respectively
Default themes from smf_2-0-2_install.tar.bz2
First of all, sorry for my english. По-русски у меня получается значительно лучше.

Проблема на форуме? Сначала посмотрите лог ошибок вашего форума и лог ошибок сайта (error_log)

You can try other modifications - see demo

emanuele

In Curve I have $options['display_quick_mod'] at lines 460 and 765.
And in both cases the code looks like:
if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && [...]
so it first check if is !empty and then the value...


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

maestrosite.ru

#4
Quote from: emanuele on February 28, 2012, 06:45:25 AM
In Curve I have $options['display_quick_mod'] at lines 460 and 765.
And in both cases the code looks like:
if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && [...]
so it first check if is !empty and then the value...

Yes, it is.

1. Have you form with id="quickModForm" in you file ?
2. Have you conditions for display this form? for dispaly start-tag "<form..." and for end-tag "</form>" ?

upd Sorry. In my previous post, analog lines: 187-188, 603-604 - it said about Core.
For Curve - lines in first post.
First of all, sorry for my english. По-русски у меня получается значительно лучше.

Проблема на форуме? Сначала посмотрите лог ошибок вашего форума и лог ошибок сайта (error_log)

You can try other modifications - see demo

emanuele

Quote from: maestrosite.ru on February 28, 2012, 06:58:07 AM
1. Have you form with id="quickModForm" in you file ?
Yes, it's at line 188

Quote from: maestrosite.ru on February 28, 2012, 06:58:07 AM
2. Have you conditions for display this form? for dispaly start-tag "<form..." and for end-tag "</form>" ?
No, not in Curve neither in Core.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

maestrosite.ru

Quote from: emanuele on February 28, 2012, 07:50:50 AM
Quote from: maestrosite.ru on February 28, 2012, 06:58:07 AM
1. Have you form with id="quickModForm" in you file ?
Yes, it's at line 188

Quote from: maestrosite.ru on February 28, 2012, 06:58:07 AM
2. Have you conditions for display this form? for dispaly start-tag "<form..." and for end-tag "</form>" ?
No, not in Curve neither in Core.

This means that there is a logical error. One part form dispaly without conditions, other parts with conditions, isn't it?
First of all, sorry for my english. По-русски у меня получается значительно лучше.

Проблема на форуме? Сначала посмотрите лог ошибок вашего форума и лог ошибок сайта (error_log)

You can try other modifications - see demo

emanuele

#7
You said "logic error" I was looking for a condition... :P

BTW this is not a bug because the same form is used for the "quick edit", so it is necessary there on every page load.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

maestrosite.ru

Quote from: emanuele on February 29, 2012, 05:12:07 AM
You said "logic error" I was looking for a condition... :P

BTW this is not a bug because the same form is used for the "quick edit", so it is necessary there on every page load.

Small fix (8 lines), and "quick edit" independents of any form
First of all, sorry for my english. По-русски у меня получается значительно лучше.

Проблема на форуме? Сначала посмотрите лог ошибок вашего форума и лог ошибок сайта (error_log)

You can try other modifications - see demo

maestrosite.ru

First of all, sorry for my english. По-русски у меня получается значительно лучше.

Проблема на форуме? Сначала посмотрите лог ошибок вашего форума и лог ошибок сайта (error_log)

You can try other modifications - see demo

Advertisement: