Need help updating sql via template form

Discuss the development of future releases of phpBB (phpBB 3.x minor releases) and MODing/Coding related questions.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
guyb
New member
New member
Posts: 17
Joined: 30 Sep 2009, 08:21
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Need help updating sql via template form

Postby guyb » 30 Sep 2009, 08:43


User avatar
Obsidian
Supporter
Supporter
Posts: 736
Joined: 13 May 2008, 15:20
Real name: Damian
Contact:

Re: Need help updating sql via template form

Postby Obsidian » 30 Sep 2009, 18:20

Hi there. From what it seems to me, upon firing the SQL query you are using variables that are not set.

Additionally, you are pulling data right from $HTTP_POST_VARS, which is highly insecure and not recommended if you are using phpBB3. You'll want to read this if that is the case: http://wiki.phpbb.com/Request_var

guyb
New member
New member
Posts: 17
Joined: 30 Sep 2009, 08:21
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Need help updating sql via template form

Postby guyb » 30 Sep 2009, 21:18


guyb
New member
New member
Posts: 17
Joined: 30 Sep 2009, 08:21
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Need help updating sql via template form

Postby guyb » 30 Sep 2009, 21:40


User avatar
Obsidian
Supporter
Supporter
Posts: 736
Joined: 13 May 2008, 15:20
Real name: Damian
Contact:

Re: Need help updating sql via template form

Postby Obsidian » 30 Sep 2009, 22:41


guyb
New member
New member
Posts: 17
Joined: 30 Sep 2009, 08:21
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Need help updating sql via template form

Postby guyb » 01 Oct 2009, 07:58


User avatar
Obsidian
Supporter
Supporter
Posts: 736
Joined: 13 May 2008, 15:20
Real name: Damian
Contact:

Re: Need help updating sql via template form

Postby Obsidian » 01 Oct 2009, 15:36


guyb
New member
New member
Posts: 17
Joined: 30 Sep 2009, 08:21
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Need help updating sql via template form

Postby guyb » 01 Oct 2009, 15:59


User avatar
Obsidian
Supporter
Supporter
Posts: 736
Joined: 13 May 2008, 15:20
Real name: Damian
Contact:

Re: Need help updating sql via template form

Postby Obsidian » 01 Oct 2009, 17:09

Uhh, not sure what you are trying to do there with the value of the submit button, because submit only returns 1 or 0 for post submission -- value is only the text displayed for the button's visible label.
You may need another hidden input there for the mode.

guyb
New member
New member
Posts: 17
Joined: 30 Sep 2009, 08:21
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Need help updating sql via template form

Postby guyb » 01 Oct 2009, 20:26

If you were referring to this: "value="{L_ADMIN_AUCTION_OFFER_FIELD_EDIT}"" that's just a preset text variable for the button. This mod uses that approach a lot instead of hardcoding a text phrase in the site pages.

guyb
New member
New member
Posts: 17
Joined: 30 Sep 2009, 08:21
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Need help updating sql via template form

Postby guyb » 01 Oct 2009, 22:53

Attachments
auction-mod-acp.JPG

User avatar
Obsidian
Supporter
Supporter
Posts: 736
Joined: 13 May 2008, 15:20
Real name: Damian
Contact:

Re: Need help updating sql via template form

Postby Obsidian » 02 Oct 2009, 01:11

Hmmm...I really don't have enough experience with phpBB2 coding methods, so I would suggest you try going to this site, http://www.phpbb2refugees.com/

guyb
New member
New member
Posts: 17
Joined: 30 Sep 2009, 08:21
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Need help updating sql via template form

Postby guyb » 02 Oct 2009, 16:55


User avatar
Obsidian
Supporter
Supporter
Posts: 736
Joined: 13 May 2008, 15:20
Real name: Damian
Contact:

Re: Need help updating sql via template form

Postby Obsidian » 02 Oct 2009, 18:46

It looks like the second example initializes $mode if the appropriate GET or POST var isn't set anyways, which is actually a smart thing to do (as it is error-proofing that way), however the code itself isn't quite so clean and (if this were in phpBB3) could be a lot easier to read.


[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Return to “phpBB Development discussion”

Who is online

Users browsing this forum: No registered users and 3 guests