Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with forum_sub and php 7.1.6 #2852

Closed
Jimmi08 opened this issue Nov 7, 2017 · 1 comment
Closed

problem with forum_sub and php 7.1.6 #2852

Jimmi08 opened this issue Nov 7, 2017 · 1 comment

Comments

@Jimmi08
Copy link
Contributor

Jimmi08 commented Nov 7, 2017

I tested this on php 7 (probably 7.0) on localhost and it worked without problems

On live site I couldn't get forum_sub dropdown displayed and only difference is php version. This part:

			$data = e107::getDb()->retrieve('forum', 'forum_id,forum_name,forum_parent', 'forum_id != 0',true);
			$this->forumParents[0] = FORLAN_216;
			$forumSubParents = array();

			foreach($data as $val)
			{
				$id = $val['forum_id'];

				if($val['forum_parent'] == 0)
				{
					$this->forumParents[$id] = $val['forum_name'];
				}
				else
				{
					$forumSubParents[$id] = $val['forum_name'];
				}

			}

			$this->fields['forum_parent']['writeParms'] = $this->forumParents;
			$this->fields['forum_sub']['writeParms']['optArray'] = $forumSubParents;
			$this->fields['forum_sub']['writeParms']['default'] = 'blank';

I tested, that $forumSubParents is correctly filled. Because forum_parent dropdown works, I used $this->forumParents as value for forum_sub and nothing was displayed.

Only way I was able to fix it and get dropdown displayd was this:
$this->fields['forum_sub']['writeParms'] = $forumSubParents;
but this way I need always set blank page.


this is not related but I think that correct query should be (added forum_sub), so you can add as forum_sub only forum that is not already assigned to some forum.

$data = e107::getDb()->retrieve('forum', 'forum_id,forum_name,forum_parent,forum_sub', 'forum_id != 0',true);

				else
				{
          	if($val['forum_sub'] == 0)
    				{
    					$forumSubParents[$id] = $val['forum_name'];
    				}
					
				}
@Jimmi08
Copy link
Contributor Author

Jimmi08 commented Nov 17, 2017

closing in favour #2870

@Jimmi08 Jimmi08 closed this as completed Nov 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant