Jump to content
View in the app

A better way to browse. Learn more.

IPBMafia.ru - поддержка Invision Community, релизы, темы, плагины и приложения

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Т.к. я использую форум с авторизацией в программе через API с использование ключа, то тут возникла проблема.

Пример авторизации происходит так:

https://SiteName/applications/nexus/interface/licenses/?info&key=MY_KEY

То у меня выбивает ошибку с ответом 400

{"errorCode":0,"errorMessage":"INTERNAL_ERROR"}

Методом подстановки и сравнения файлов. Выяснилось, что подобная проблема проявляется в файле:

../system/Node/Model.php

В функции на 1145-ой строке.

В 4.4.4 функция выглядит вот так:

	public function children( $permissionCheck='view', $member=NULL, $subnodes=TRUE, $skip=null, $_where=array() )
	{
		$children = array();

		/* Load member */
		if ( $permissionCheck !== NULL )
		{
			$member = ( $member === NULL ) ? \IPS\Member::loggedIn() : $member;
			$cacheKey	= md5( $permissionCheck . $member->member_id . $subnodes . json_encode( $skip ) . json_encode( $_where ) );
		}
		else
		{
			$cacheKey	= md5( $subnodes . json_encode( $skip ) . json_encode( $_where ) );
		}
		if( isset( $this->_childrenResults[ $cacheKey ] ) )
		{
			return $this->_childrenResults[ $cacheKey ];
		}

В 4.4.6 функция выглядит вот так:

	public function children( $permissionCheck='view', $member=NULL, $subnodes=TRUE, $skip=null, $_where=array() )
	{
		$children = array();

		$member = $member ?: \IPS\Member::loggedIn();

		/* Load member */
		if ( $permissionCheck !== NULL AND \in_array( 'IPS\Node\Permissions', class_implements( $this ) ) )
		{
			$cacheKey	= md5( $permissionCheck . $member->member_id . $subnodes . json_encode( $skip ) . json_encode( $_where ) );
		}
		else
		{
			$cacheKey	= md5( $subnodes . json_encode( $skip ) . json_encode( $_where ) );
		}
		if( isset( $this->_childrenResults[ $cacheKey ] ) )
		{
			return $this->_childrenResults[ $cacheKey ];
		}

Как видим у условии, есть 3 изменения:

1. Вместо

if ( $permissionCheck !== NULL )

Стоит

if ( $permissionCheck !== NULL AND \in_array( 'IPS\Node\Permissions', class_implements( $this ) ) )

Здесь все хорошо, движок не выбивает ошибку.

2. Строка с переменной $member выведена перед условием $permissionCheck и имеет вид:

Вместо

$member = ( $member === NULL ) ? \IPS\Member::loggedIn() : $member;

Стоит

$member = $member ?: \IPS\Member::loggedIn();

 

Пока что временным решением стоит следующее решение:

Новая переменная $member из 4.4.6 возвращена в условие $permissionCheck. Полет нормальный, API работает.

Результат исправления в коде:

	public function children( $permissionCheck='view', $member=NULL, $subnodes=TRUE, $skip=null, $_where=array() )
	{
		$children = array();
		
		/* Load member */
		if ( $permissionCheck !== NULL AND \in_array( 'IPS\Node\Permissions', class_implements( $this ) ) )
		{
			$member = $member ?: \IPS\Member::loggedIn();
			$cacheKey	= md5( $permissionCheck . $member->member_id . $subnodes . json_encode( $skip ) . json_encode( $_where ) );
		}
		else
		{
			$cacheKey	= md5( $subnodes . json_encode( $skip ) . json_encode( $_where ) );
		}
		if( isset( $this->_childrenResults[ $cacheKey ] ) )
		{
			return $this->_childrenResults[ $cacheKey ];
		}

У кого есть возможность отправить в багфикс IPS - сделайте. Ошибка очень нелицеприятная

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Ответить в этой теме...

Последние посетители 0

  • No registered users viewing this page.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.