1. CStrategies

    XF 2.1 Capturing "Reject with Reason" for resources in approval queue

    I am building an add-on to enable the same "Reject with Reason" approval controls found when a user registrations shows up in the moderator approval queue, but do it for resources posted with the XenForo Resource Manager which by default only gives the option to "approve" or "delete". The...
  2. giperfast

    XF 2.2 Updating a new user entity field via REST API

    I extended the "XF\Entity\User" class to add a new field to get it when authorizing with ('api/auth/from-session'). The code looks like this: class User extends XFCP_User { protected function setupApiResultData(\XF\Api\Result\EntityResult $result, $verbosity = self::VERBOSITY_NORMAL, array...
  3. Kier

    Beta PhpStorm Live Templates for XenForo 2 20210519

    This is an export of the Live templates I use for XenForo development in PhpStorm. You can see them in use in the Building with XenForo 2 video series. The list of templates is far from complete, and will be updated periodically as I get around to it but in the interest in sharing useful work...
  4. Kruzya

    Lack of interest Move Bookmark postDelete method to behavior

    Currently, for correct work bookmark on custom entities, developer should call method like _postDeleteBookmarks() in _postDelete() in own entity. For reactions, no one additional method don't should be called, because for reactions in structure added additional behavior XF:Reactable. I suggest...
  5. CMTV

    Unmaintained Pretty names and values in "User change log"

    When you update any (even custom) column of User entity XenForo automatically adds a new entry to "User change log". The only exception here is using fastUpdate() method. It directly updates the database without calling save() so any changes made that way will not appear in log. Let's say you...
  6. adamsmasher

    XF 2.0 Entity structure change on post render only

    Is there a way to update the structure of the post entity, but only when displaying a thread and not when posting to the thread. The columns I'm adding are needed when you view a post, but I don't want them added to the structure when trying to save a new post as these columns don't actually...
  7. CMTV

    XF 2.1 Old title returned without page reload

    My entity class has a MasterTitle relation and title getter: public function getTitle() { $definition = $this->Definition; $paramPhrase = \XF::phrase($this->getPhraseName()); return $paramPhrase->render('html', ['nameOnInvalid' => false]) ?: ($definition ? $definition->title : ''); }...
  8. CMTV

    XF 2.0 Why nullable entity ID?

    The question is stated in the title of this thread. @property int|null trophy_id 'trophy_id' => ['type' => self::UINT, 'autoIncrement' => true, 'nullable' => true] Should I do the same with my entities? What about string IDs? String UserField ID, for example, is not marked as nullable
  9. CMTV

    Lack of interest AbstractCriteria is not abstract

    Hey! Imagine we are creating an addon for removing all posts that match selected criteria. A list of available criteria: Post has at least X likes Post author has an X username Post was edited at least X times Post was edited no more than X times Post was published before X Post was published...
  10. CMTV

    XF 2.0 TO_MANY relation through many-to-many table

    Hi! The question is simple. I hope it is. I have three tables: criteria, params and criteria_params. The last one consists of two columns with criterion and param IDs. So it is a many-to-many relation between criteria and params. One criteria can have many params. One param can belong to any...
  11. CMTV

    XF 2.0 Create relation entity if not exists

    Hi! I want for Trophy entity to have default relation with TrophyData entity. $structure->relations = array_merge($structure->relations, [ 'UP' => [ 'entity' => 'UserProgression:TrophyData', 'type' => self::TO_ONE, 'conditions' => 'trophy_id', 'primary' =>...
  12. CMTV

    XF 2.0 Order by phrase

    Hi! I am getting my entitites from database with this code: return $this->finder('UserProgression:Title')->with('MasterTitle'); Later I fetch the results: $titles = $this->getTitleRepo()->getTitleListData()->fetch(); // >>>Sort by $title->title field?<<< $viewParams = [ 'titles' =>...
  13. CMTV

    XF 2.0 Table with ID only?

    Hi! I want to create a list of titles (just like trophies) which users can select. The title enitity structure consists of title_id and the title phrase. But for title I want to use MasterTitle relation so I don't need title column. It seems I have to create a table xf_addonid_title with only...
  14. WeaponOwl

    XF 2.0 TO_MANY relation and templates

    Hello. I see very strange behaviour. I have entity 'MissionRecord' with TO_MANY relation to 'NpcMissionRecord', if try load this entity with relation using default finder $this->finder('.../MissionRecord') ->with('NpcMissionRecord') ->where('id', $id) ->fetch(); i receive...
Top Bottom