[deleted] I've edited the official GitHub oauth extension because it contains all the stuff that i need and is not very difficult to understand. However, I am unable to get my extension loaded, i can activate it in the forum but no code at all gets executed (even if i add an echo statement inside the bootstrap.php it won't show up). I haven't worked with composer before. Also, i've enabled the debug option but haven't been able to find any logs or anything concerning my module. EDIT: there was a typo in Controller.php, i fixed that, but it didn't resolve the issue Thank you in advance. My code is here: https://github.com/Cl1608Ho/flarum-ext-discord-webhook
[deleted] Yes I did. (it's referred in the sticky post about what you should read before posting.....) This issue isnt about getting composer to install the extension. I've already read about that and I think I understand composer's process well enough to be able to insert the right repository and require stuff. But as I wrote above, I can require it normally through composer, activate it in the administration panel of my fresh 0.1.0.beta.6 install but the code never gets executed regardless of what I tried so far (even a static echo in the bootstrap.php function didn't work). That's puzzling me (and that I can't find it in the flarum.log or anywhere else) APPENDIX: what I haven't found so far in the api documentations (for example here: http://apidocs.flarum.org/0.1.0/php/Flarum/Event.html) is a way to get a list of the tags a discussion is assigned (and specifically the color of a tag). EDIT: I understand that tags are a plugin on their own, but is there no way at all to interact with an other plugin?
datitisev [deleted] I see you've linked Flarum's API Documentation. That official link is outdated. I host a community-provided documentation at https://datitisev.github.io/FlarumAPIDocs for every tag, master and next-front/back, for the JavaScript and PHP API Docs. Now, I see you have mentioned flarum.log. I believe it is there for decoration ? You will want to check the PHP log, usually called php_error.log, but its location differs depending on the operative system you are using.
[deleted] Wow in that case I would strongly recommend updating the flarum.org/docs/extend. Thank you very much! I will look into it ? UPDATE: In the php error log i only found this: [Sun Jan 01 11:38:14.520954 2017] [:error] [pid 6037] [client xxx.xxx.xxx.xxx:3835] PHP Deprecated: The third argument to Zend\\Stratigility\\MiddlewarePipe() ($out) will be required starting with Stratigility version 2; please see https://docs.zendframework.com/zend-stratigility/migration/to-v2/ for more details on how to update your application to remove this message. in /var/www/flarum.xxx.xxx/vendor/zendframework/zend-stratigility/src/MiddlewarePipe.php on line 101, referer: https://flarum.xxx.xxx/d/2-test/3 Apart from my code doesn't contain errors, but that may be because its not actually executed.
datitisev [deleted] Do you have your root (Flarum directory) package.json set up for local extensions? Is your extension required with the version of @dev? Did you run composer update with no errors in the root directory?
[deleted] Yes I did, but as I pointed out twice already, composer isn't the issue, frankly. Composer require works fine, and the module shows up in the administration section of my forum. Just the code that is in the extension doesn't seem to get executed, that's why I originally asked that one could look at it to see if I'm doing anything completely wrong (so wrongly that it doesn't cause any error to appear) instead of telling twice what I already read twice before opening this thread. (sorry if this is a bit harsh now, I appreciate the effort anyway ?)
[deleted] Thanks, Davis, but could you please point out what exactly is wrong? I mean I copy-pasted this from the github login extension and double-checked with another auth extension. (and I did run it through a lint check which didn't make up anything..... Thank you in advance
Davis [deleted] https://github.com/Cl1608Ho/flarum-ext-discord-webhook/blob/master/bootstrap.php#L7 should be: $events->subscribe(Cl11608Ho\DiscordWebhook\Controller::class); Same with line 8. And you'll want to remove line 3.
[deleted] Isn't that how the use works....? But yeah, probably I got this wrongly.... UPDATE: That didn't change anything with my code not getting executed.... Unfortunately
datitisev [deleted] Can you show us Flarum's composer.json and where you have the extension located? Example: - composer.json - workbench/ - author-flarum-ext-name/ - bootstrap.php - composer.json
Davis You should try going through and try putting echo "Test"; die(); in various places to see where it's not working. So I'd start by putting that in the bootstrap.php and continue from there.
[deleted] { "name": "flarum/flarum", "description": "Delightfully simple forum software.", "type": "project", "keywords": ["forum", "discussion"], "homepage": "http://flarum.org", "license": "MIT", "authors": [ { "name": "Toby Zerner", "email": "toby.zerner@gmail.com" }, { "name": "Franz Liedke", "email": "franz@develophp.org" } ], "support": { "issues": "https://github.com/flarum/core/issues", "source": "https://github.com/flarum/flarum", "docs": "http://flarum.org/docs" }, "require": { "flarum/core": "^0.1.0", "flarum/flarum-ext-akismet": "^0.1.0", "flarum/flarum-ext-approval": "^0.1.0", "flarum/flarum-ext-auth-facebook": "^0.1.0", "flarum/flarum-ext-auth-github": "^0.1.0", "flarum/flarum-ext-auth-twitter": "^0.1.0", "flarum/flarum-ext-bbcode": "^0.1.0", "flarum/flarum-ext-emoji": "^0.1.0", "flarum/flarum-ext-english": "^0.1.0", "flarum/flarum-ext-flags": "^0.1.0", "flarum/flarum-ext-likes": "^0.1.0", "flarum/flarum-ext-lock": "^0.1.0", "flarum/flarum-ext-markdown": "^0.1.0", "flarum/flarum-ext-mentions": "^0.1.0", "flarum/flarum-ext-pusher": "^0.1.0", "flarum/flarum-ext-sticky": "^0.1.0", "flarum/flarum-ext-subscriptions": "^0.1.0", "flarum/flarum-ext-suspend": "^0.1.0", "flarum/flarum-ext-tags": "^0.1.0", "Cl1608Ho/flarum-ext-discord-webhook": "^0.1.0@beta" }, "repositories": [ { "url": "/root/flarum-ext-discord-webhook", "type": "path" } ], "require-dev": { "franzl/studio": "^0.11.0" }, "config": { "preferred-install": "dist" }, "minimum-stability": "beta", "prefer-stable": true } And that's it, basically. The path is right and I double-checked that the code inside vendor/ is the same as under /root/flarum-ext-discord-webhook (I added the repository section and then did composer require I already tried the echo but will try adding die() too, not sure if that changes something. UPDATE: wherever I put it, it never gets executed.... As i stated in the very first post
datitisev [deleted] Some things: The repository may be formed incorrectly (in repositories[0]) or not accessible The version for Cl1608Ho/flarum-ext-discord-webhook in require needs to be *@dev
[deleted] Sorry, I realized it the moment you told me and i was going to tell you that I already double-checked the code and then I realized composer told me about symlinking.... Checked it and it was just how fact symlinked and it turned out to be a permissions problem, that although i was root when editing the source and when running composer require the Apache user wasn't able to read the source because it was just symlinked..... Fixed that, now I'm getting an error message which doesn't really makes sense to me, too..... Thanks for all the effort (and I am still wondering why nothing there complained about missing permissions......nowhere) Anyway, here is the problem: 06 08:55:09.380808 2017] [:error] [pid 28616] [client xxx.xxx.xxx.xxx:61xxx] PHP Fatal error: Uncaught ReflectionException: Class Cl1608Ho\\DiscordWebhook\\Listener\\AddClentAssets does not exist in /var/www/flarum.xxx.org/vendor/illuminate/container/Container.php:741 Stack trace: #0 /var/www/flarum.xxx.org/vendor/illuminate/container/Container.php(741): ReflectionClass->__construct('Cl1608Ho\\\\Discor...') #1 /var/www/flarum.xxx.org/vendor/illuminate/container/Container.php(631): Illuminate\\Container\\Container->build('Cl1608Ho\\\\Discor...', Array) #2 /var/www/flarum.xxx.org/vendor/flarum/core/src/Foundation/Application.php(513): Illuminate\\Container\\Container->make('Cl1608Ho\\\\Discor...', Array) #3 /var/www/flarum.xxx.org/vendor/illuminate/events/Dispatcher.php(149): Flarum\\Foundation\\Application->make('Cl1608Ho\\\\Discor...') #4 /var/www/flarum.xxx.org/vendor/illuminate/events/Dispatcher.php(135): Illuminate\\Events\\Dispatcher->resolveSubscriber('Cl1608Ho\\\\Discor...') #5 /var/www/flarum.xxx.org/flarum-ext-discord-webhook/bootstrap.php(7): Illuminate\\Events\\Dispatcher->subscribe('Cl in /var/www/flarum.xxx.org/vendor/illuminate/container/Container.php on line 741 I think some kind of wrong usage, but I don't know exactly where (source on github is a bit outdated that it doesn't have the changes with the use Cl1608Ho\DiscordWebhook that @Davis mentioned EDIT: due to wrong styling i didn't quite read the error message..... Just a typo. Another EDIT: now, could one answer my question whether it is possible to integrate tags into an extension, eg getting all tags in the whole forum or getting all tags of a certain discussion
luceos [deleted] Another EDIT: now, could one answer my question whether it is possible to integrate tags into an extension, eg getting all tags in the whole forum or getting all tags of a certain discussion Please create separate topics for each different unrelated issue, that helps others in assisting you