e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
321 stars 214 forks source link

Bug in links.php #911

Closed Crytiqal closed 9 years ago

Crytiqal commented 9 years ago

Admin Area --> Site links --> Manage

When trying to update the user class for which the link is visible:

Error SQL Update Error

CaMer0n commented 9 years ago

Please enable debug and test again

Crytiqal commented 9 years ago

I am really sorry but for some reason it works now...

I am trying to figure out what I changed. I enabled developer functions and turned it back afterwards but it still works so it can't be that.

Hopefully it was just an odd occurrence on my end then?

EDIT: I think I added new userclasses of my own. And I am not sure if I went into Admin Area --> User Classes --> Preferences and executed those functions before or after...

I could try again on a new install tomorrow. I'll get back to you.

CaMer0n commented 9 years ago

Okay. Thank you!

Crytiqal commented 9 years ago

I dropped the e107 table, ran the install.php again, and it seems to be working properly.

Crytiqal commented 9 years ago

I get this bug again...

Log says:

Array ( [link_button] => [link_name] => BattleBot [link_category] => 1 [link_parent] => [link_url] => battlebot.php [link_sefurl] => [link_class] => 0 [link_description] => [link_order] => 0 [link_open] => 0 [link_function] => [link_owner] => )

SQL Insert Error - Fail

CaMer0n commented 9 years ago

Would you mind please turning on debug (Sql Details), it should provide more details than that.

Crytiqal commented 9 years ago

Ok, first off, in main admin area:

SELECT * FROM e107_banner LIMIT 1
Table 'e107.e107_banner' doesn't exist

Second, in settings, site links:

System Debug e_url.php in ../e107_plugins/gallery is missing the key: gallery. Or, you may need to scan your plugin directories to register e_url.php

Thirdly, when create a new link named TEST and url test.php:

System Debug SQL Error #1366: Incorrect integer value: '' for column 'link_parent' at row 1

INSERT INTO e107_links (link_id,link_button,link_name,link_category,link_parent,link_url,link_sefurl,link_class,link_description,link_order,link_open,link_function,link_owner) VALUES (0, '', 'Test', '1', '', 'test.php', '', '0', '', '0', '0', '', '') Incorrect integer value: '' for column 'link_parent' at row 1

Hope this helps

Crytiqal commented 9 years ago

As expected by the error, making it a sublink works :)

I think the default value for link_parent should be either a forced integer '0' or not forced at all?

CaMer0n commented 9 years ago

That's correct, it needs to be a forced integer. Thank you for this debug information - it helps a lot! I thought I was running in strict mode in my local setup, but it appears I wasn't. Once that was corrected, I was able to reproduce the problem and correct the issue.