-
Posts
177 -
Joined
-
Last visited
Content Type
Downloads
Release Notes
IPS4 Guides
IPS4 Developer Documentation
Invision Community Blog
Development Blog
Deprecation Tracker
Providers Directory
Forums
Events
Store
Gallery
Posts posted by Sly_Ripper
-
-
Steps to reproduce
- Enable/set up 2FA
- Log into forum
- Attempt to log into external app with the forum's OAuth (/oauth/authorize/?client_id=client_id_here&response_type=code&scope=scopes&prompt=login)
- Upon logging in you will be redirected to the forum homepage, not the correct redirect url
- Disabling 2FA fixes this, as does logging out of the forum first
-
When "show on member's profile" is set to "Do not show", it will also not show on content submissions when that's set to show. The content submission setting should either apply or be disabled
Edit: actually, when content submissions was set to "show to all" it was being treated as "show to staff and profile owner"
-
Yeah this needs fixing, or at least display a message to clear the cache
-
Allow IN_DEV with designer's mode, huge pain in the ass
-
-
From what I can tell, this seems to be by design? Even deleting a forum in the admin panel has the same effect. Topics aren't considered children of a Forum, but a content item. Although there's a confirmation on deleting in the admin panel, there's no indication that all the topics will be left in limbo.
-
1 hour ago, Jim M said:
Have the background tasks completely finished for the process here? Can check this in ACP -> System -> Dashboard -> Background Processes.
It didn't appear to even create a background task
-
Topics are orphaned despite passing 'deleteChildrenOrMove' when deleting a forum via the API, they should be moved.
Not moved:
-
[2023-07-04T16:42:25,544][INFO ][o.o.c.m.MetadataDeleteIndexService] [e14911be311d] [content/YyPDIyO8TqCQgJPetdn7UA] deleting index [2023-07-04T16:42:25,582][INFO ][o.o.a.u.d.DestinationMigrationCoordinator] [e14911be311d] Detected cluster change event for destination migration [2023-07-04T16:42:25,583][ERROR][o.o.i.i.ManagedIndexCoordinator] [e14911be311d] get managed-index failed: [.opendistro-ism-config] IndexNotFoundException[no such index [.opendistro-ism-config]]
Definitely broken, tried opensearch 2.0.1 and 2.1.0. When rebuilding, the index is deleted and not re-created.
Tried elasticsearch 7.17.10 and it works fine. -
2 hours ago, Matt said:
I'd check with your host and look for any rewrite rules.
It's a localhost dev install, the URLs are being generated like this:
-
I considered attaching the sub-forums to clubs but forums that are part of a club are still loaded on index/forum views.
An Invision install with clubs enabled are possibly prone to this slowdown, I don't know if the club rows are evaluated or not.
-
2 minutes ago, Jim M said:
Do you have a use case which would warrant 20k sub-forums? Think that is an insanely large amount that wouldn't be commonplace.
Basically, we create a sub-forum for every PlayStation game so topics stay organised. Similar to how every game on Steam has it's own sub-forum: https://steamcommunity.com/discussions/#games
-
Continuing from this topic:
The board index (and I assume any forum listing) grabs every row from forums_forums, this could be 20k sub-forums. The board index should only grab nodes/categories with a parent ID of -1 and then any forums with those results as a parent, and sub-forums of that parent. The only reason I can think of that it's not done this way is to provide the correct "last post" info for the user's permissions. It would be nice to have an option to just limit the "last post" depth to 1 sub-forum deep and have a more performant forum.
-
This also happens on the front end
-
Tested on a fresh install, for some reason 'app' is being replaced with the domain
-
19 hours ago, Stuart Silvester said:
Thanks for the follow up.
That helps explain the issue you're having. When you're updated the allowed IDs in the __construct() method, the \IPS\Member object has to be instantiated in order for that code to run. This happens automatically when using this code has a front/admin session available in normal use on the front end (which is why we're all expecting it to be working).
Solving this (although not pretty) would be as simple as putting this in your code before you load the member.
new \IPS\Member;
Solved, thanks
-
10 minutes ago, Stuart Silvester said:
We've used this approach in a lot of plugins, so I know it's working properly. Make sure that you actually have a `remote_id` column created in the `core_members` table.
It may also be worthwhile to show the log from the system log page in the support section. The JSON is not a real error.
Although, these days we would recommend keeping track of SSO data in your own table so that you're not modifying core tables.
I mentioned the line that throws the error in the first post, using the doc's code, '$databaseIdFields' is not being overwritten by the hook correctly.
#0 /app/system/Member/Member.php(240): IPS\Patterns\_ActiveRecord::load() #1 /app/applications/appname/api/members.php(28): IPS\_Member::load() #2 /app/system/Api/Controller.php(180): IPS\appname\api\_members->GETitem() #3 /app/system/Dispatcher/Api.php(343): IPS\Api\_Controller->execute() #4 /app/api/index.php(11): IPS\Dispatcher\_Api->run() #5 {main}
Doing it this way works, probably not the best idea though:
class appname_hook_CustomMemberColumns extends _HOOK_CLASS_ { protected static $databaseIdFields = array('name', 'email', 'remote_id');
-
On 6/19/2023 at 5:30 PM, teraßyte said:
I think we need to take a step back and start from scratch here.
What are you trying to do exactly?
- If you just need to load a member by using their ID, you don't need the hook or the remote_id value.
- Or are you trying to load a member based on some kind of external ID after adding a remote_id column to the core_members table in the database?
Knowing your goal would help guide you in the correct direction.
2
@Matt this is either a bug or bad docs
-
55 minutes ago, teraßyte said:
Yes, that seems indeed correct. Try adding this code right before the parent call:
var_dump( static::$databaseIdFields );exit;
If the hook is being loaded properly, you should get an output of 3 values: name, email, remote_id.
If you don't get anything, maybe there's a typo in the class you're trying to extend. Something like \IPS\Members instead of \IPS\Member. I had it happen a few times. 😅
array(3) { [0]=> string(4) "name" [1]=> string(5) "email" [2]=> string(9) "remote_id" }
Still throws an error when trying to load a member with 'remote_id'. Being in an API route shouldn't make a difference?
-
12 hours ago, teraßyte said:
As long as you fixed the parent call being outside the function in the example, it should work.
I you post here the hook's code I can take a quick look maybe.
It's literally just a fresh hook and the example code
//<?php /* To prevent PHP errors (extending class does not exist) revealing path */ if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) ) { exit; } class appname_hook_CustomMemberColumns extends _HOOK_CLASS_ { /** * Add our own column to default fields */ public function __construct() { static::$databaseIdFields = array_merge( static::$databaseIdFields, array( 'remote_id' ) ); parent::__construct(); } }
-
47 minutes ago, teraßyte said:
You can only use the allowed values in the \IPS\Member class for the second parameter:
/** * @brief [ActiveRecord] Database ID Fields */ protected static $databaseIdFields = array( 'name', 'email' );
If you want to load based on the member_id column, simply skip the second parameter. You need to provide it only if you're loading a member based on their name or email address.
Ah you're right. What about with custom columns? My hook is valid since inputting a column that doesn't exist here throws an error, with a valid column it throws the same error as before:
static::$databaseIdFields = array_merge( static::$databaseIdFields, array( 'remote_id' ) );
-
Fresh install, trying to add an API route but Member::load breaks any time I pass $idField, even default fields.
works:
$member = \IPS\Member::load(1);
$member = \IPS\Member::load(1, 'member_id');
Returns
{ "errorCode": "EX0", "errorMessage": "" }
System log says "InvalidArgumentException (0)", viewing the log shows OutOfRangeException from line 115 /app/system/Patterns/ActiveRecord.php
Also, the docs need fixing:
/** * Add our own column to default fields */ public function __construct() { static::$databaseIdFields = array_merge( static::$databaseIdFields, array( 'remote_id' ) ); } parent::__construct();
-
On this page: https://invisioncommunity.com/developers/rest-api?endpoint=forums/forums/POSTindex (and any others regarding permissions)
QuoteAn object with the keys as permission options (view, read, add, reply, attachments) and values as permissions to use (which may be * to grant access to all groups, or an array of group IDs to permit access to)
I kept getting the following error when sending an object
{ "errorCode": "EX1364", "errorMessage": "UNKNOWN_ERROR" }
It needs to be sent as an array:
Also, "an array of group IDs", if you send an array "[3]" it will literally insert that into the DB, it still seems to function but is probably wrong:
-
4 hours ago, Ahmad E. said:
Are you using nginx only or are you using nginx as a proxy for apache? Never used plesk myself so not sure.
Nginx and php-fpm, tested it in Apache and it worked.
Edit:
I created an API key while using Apache, switched over to Nginx and using that key gives a valid result, but still using "test" as the key fails (and so the AdminCP shows no options to add/edit keys yet).>curl http://localhost/forums/api/core/hello --user a33cb937a4953c72bc4da6e89da39e51: { "communityName": "IPS Community Suite", "communityUrl": "http:\/\/localhost\/forums\/", "ipsVersion": "4.1.6" } >curl http://localhost/forums/api/core/hello --user test: { "errorCode": "3S290\/7", "errorMessage": "INVALID_API_KEY" }
@bfarber Should I submit a bug report?
[Bug] 2FA breaks OAuth flow
in Feedback
Posted
Using OAuth while you’re already authenticated with the forum.
If 2FA is enabled, after inputting user/pass you’re just redirected to the forum index instead of triggering 2FA/redirecting to the redirect URL set in the oauth app.
Disabling 2FA or logging out of the forum first both work fine.