[deleted]
hrvoje_hr Users can't comment on old posts
That's not technically true. If you disable the ability to comment on a post, save it, then re-enable and save again, this will create a forum topic which can be replied to.
hrvoje_hr Users can't comment on old posts
That's not technically true. If you disable the ability to comment on a post, save it, then re-enable and save again, this will create a forum topic which can be replied to.
hrvoje_hr if you disable and enable comments on old posts it works (maybe whenever the post is updated?). Maybe there's a WordPress plugin or something that just updates all of the posts one time. That way old posts will have comments.
danielunited if you disable and enable comments on old posts it works (maybe whenever the post is updated?). Maybe there's a WordPress plugin or something that just updates all of the posts one time. That way old posts will have comments.
Correct.
[deleted] That's not technically true. If you disable the ability to comment on a post, save it, then re-enable and save again, this will create a forum topic which can be replied to.
Oh, I didn't know that. However, doing that on 2k+ posts would only spam the forum. But it's great to know that it's possible.
hrvoje_hr That's true. I found this out by trial and error yesterday. The issue I have is that I collect news sources from around the world on an RSS feed which then populates WordPress and creates posts. These aren't automatically created on the forum (which they should be) unless I disable then enable comments on each of them.
Not great.
However, if you have WordPress CLI, then you should do
wp post list --format=ids | xargs wp post update --comment_status=closed
then
wp post list --format=ids | xargs wp post update --comment_status=open
On a scheduled basis, or periodically to resolve this. It's not very clean, and on a blog with thousands of posts, it could place an unprecedented load on your server (ideally, you'd restrict this to say the last 10 posts etc). I'd much rather that the WordPress plugin from @clarkwinkelmann handled this on the fly.
EDIT - and I can validate that the commands I posted work great. You need to install WP CLI if you are permitted to do this by your host (or on your own VPS if applicable) - see here for a working guide - https://wp-cli.org/
By accident, I discovered today that a lot of my users can't see any WP commenting topics if there are no comments on them. At the same time when that topic gains any comment, it's shown to them.
The same goes for guests. Empty topics don't show to them.
hrvoje_hr Looks like we are uncovering some bugs here...
Found another bug. When using the PrettyMail extension, the content is missing from the email. This needs to be rectified also.
Wow... So many messages from you guys. I'll try to answer everything.
hrvoje_hr I discovered today that a lot of my users can't see any WP commenting topics if there are no comments on them
That's actually a feature. By default new discussions don't get the "last reply" relationship set so that creating thousands of discussions for example (as mentioned above), won't render your forum hopepage unreadable. As soon as somebody replies from the Wordpress side, the discussion will have a last reply, and will rise to the top.
This behavior can be changed by setting Set the summary post as the last post of new discussions https://kilowhat.net/flarum/extensions/wordpress#set-the-summary-post-as-the-last-post-of-new-discussions
[deleted] When using the PrettyMail extension, the content is missing from the email
You mean the content of the Wordpress excerpt ? Just like I had to manually fix it for summaries in the frontend, I'd need to create additional logic here as well. Maybe that's what is linked to the error you shared above.
Which extension triggers an email that contains the first post ?
hrvoje_hr Comments from old posts will be gone and stay without any new comment threads. Only new posts will create new comments threads. Users can't comment on old posts
As correctly discussed above, the only way to create the missing discussions is to enable and disable commenting at the moment. If you don't have "set first post as last reply", it shouldn't spam the forum to create thousands of threads as all those new threads will appear at the very bottom of the discussion list until someone replies.
If there's enough interest, I could take a look at what would be necessary to automate the import for new users.
danielunited Bug report: Here, for example, there are 5 comments. But if you go back to the homepage it shows that there are 4 comments in the thread.
I will investigate.
danielunited Suggestion: I think it will be super useful to make the composer/commenting area always visible in the comments iframe
I'll see what I can do. The fixed height and the current iframe layout is a compromise to get everything working. I tried making the height flexible, but Flarum wouldn't play nice with it and the Composer would end up out of screen.
[deleted] I'm using RSS feeds to auto populate the WordPress post tables (via a plugin), but these new posts do not appear in Flarum unless I either
I'll investigate that. My extension uses the post_updated
and post_deleted
Wordpress hooks. post_updated
is always called when you manually create a post because you need to first save it, then publish. I might need to listen to another hook for new posts that are created in a single action.
Littlegolden this premium extension has no public documents on github. . . I don't know where to look for .yml files
Translating premium extensions is something that's not been discussed much until now... I have no problem sharing the english YML files with you. The problem is that on each update I might add or remove strings, and I'd need to send them to translators again. I'd need some way of making that file public, without giving me any extra work to keep it updated. Right now it's in a private GitHub repo with the remaining of the extension source code so I'm not sure what I can do.
clarkwinkelmann You mean the content of the Wordpress excerpt ? Just like I had to manually fix it for summaries in the frontend, I'd need to create additional logic here as well. Maybe that's what is linked to the error you shared above.
Yes, exactly that.
clarkwinkelmann Which extension triggers an email that contains the first post ?
FoF/Subscribed I think...
clarkwinkelmann If there's enough interest, I could take a look at what would be necessary to automate the import for new users.
I think this is needed to be honest.
clarkwinkelmann I'll investigate that. My extension uses the post_updated and post_deleted Wordpress hooks. post_updated is always called when you manually create a post because you need to first save it, then publish. I might need to listen to another hook for new posts that are created in a single action.
Good point. I think it's a standard hook, but the plugin I use to perform this is FeedWordPress
clarkwinkelmann That's actually a feature. By default new discussions don't get the "last reply" relationship set so that creating thousands of discussions for example (as mentioned above), won't render your forum hopepage unreadable. As soon as somebody replies from the Wordpress side, the discussion will have a last reply, and will rise to the top.
I know that, you even develop that by my request and I have it turned on. The thing is that the topic is always created and I as an admin can see it, but guests and some of other users can't see it. Even if they visit it as a link they get error 404.
You can check it yourself. I can see link bellow, but you will get error 404.
At the sam time, this is topic of the same type and you can see it because it already have comments.
hrvoje_hr you even develop that by my request and I have it turned on
ahah oops I missed that
This must be related to Flarum considering a discussion deleted if it has zero comments. Because the Wordpress summary is not a comment post, it's not counted.
I had a fix implemented in the extension already. Could you mabye try to disable and re-enable the extension ? Maybe there's a priority issue with another extension. Or there could well be an incompatibility issue with another extension. I think the issue isn't present on the demo website. Maybe it's linked to an extension like byobu that also alters the permissions for listing discussions.
clarkwinkelmann This must be related to Flarum considering a discussion deleted if it has zero comments. Because the Wordpress summary is not a comment post, it's not counted.
Yeah, that was indeed it. It's fixed with reactivation.
I'm fairly sure the problem was with Byobu as you said it. Literally no one of my users has ever complained about it until the BYOBU extension was updated yesterday.
hrvoje_hr interesting. I'll do some tests with Byobu to see if I can make this more reliable.
clarkwinkelmann I'd need some way of making that file public
How about under the name of Flagrow.io, create a github repository to put .yml / .ymal files of various premium extensions to share the translators in this way.
Littlegolden that would be an ideal solution yes, except I know @luceos already has enough work supporting the current flagrow.io and preparing its successor Extiverse. Maybe that's something that could be automated in Extiverse, but it's still quite some time away.
I'll see if I can come up with something automated when I'll release my next premium extension. 2 other extensions are coming soon and I think it'll make sense to have something available.
In the meantime my current strategy is to work with my clients if translations are necessary, so that we can maintain them in the extension and update them for new releases. As such only locales used by active clients that are willing to help with translation would be included.
Linguist remains one of the best options so that the clients and myself can both improve on our sides without too many strings attached. Also with beta 12 will finally come the fix for English fallback, so that translations for an extension like this one might not even be necessary (only a couple of rarely visible frontend strings).
clarkwinkelmann Translating premium extensions is something that's not been discussed much until now... I have no problem sharing the english YML files with you. The problem is that on each update I might add or remove strings, and I'd need to send them to translators again. I'd need some way of making that file public, without giving me any extra work to keep it updated. Right now it's in a private GitHub repo with the remaining of the extension source code so I'm not sure what I can do.
Can you create subsplit with translation files only and publish it on GitHub as public repo? It should be easy to automate.
If you want you can use an access token from flagrow.io to read premium extensions and then compile a complete repo with its language files. I'll make sure the functionality will be forward compatible.
Only thing you need is to get your admin permission back on flagrow.io to get wildcard access to all premium extensions.
Sorry everyone else. I was hoping to have the rewrite finished sooner and thus sustain and expand the functionality of extiverse earlier. This exact question was something I had an answer to. I'm currently moving and as such all time I do have is to continue managing the organization.
@clarkwinkelmann I get an error when attempting to access latest posts from my root site at phenomlab.com. This is a simple WordPress function I wrote that creates dynamic links to posts on the forum. It uses the Flarum Embed extension, but most posts generate an error when clicked.
Can this be looked at asap please ?
For info, this is the WordPress function I'm using
function front_page_news () {
$json = file_get_contents('https://forum.phenomlab.com/api/discussions');
$obj = json_decode($json, true);
//print_r($obj);
for($i = 0; $i < 12; ++$i) {
$posturl = $obj['data'][$i]['id'];
$thistitle = trim($obj['data'][$i]['attributes']['title']);
$thisurl = '<a class="recent-items" href="https://forum.phenomlab.com/d/' . $posturl . "-". $obj['data'][$i]['attributes']['slug'] . '">';
$thisitem .= "<div class='recent-list'><div class='icon'><i class='fal fa-crosshairs'></i></div>" . $thisurl . $thistitle. "<br></a></div>";
}
return $thisitem;
}
add_shortcode( 'fpn', 'front_page_news'
);
This is the error that appears in the log
[2020-02-23 15:50:52] production.ERROR: BadMethodCallException: Call to undefined method Kilowhat\Wordpress\WordpressSummaryPost::formatContent() in /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/illuminate/support/Traits/ForwardsCalls.php:50
Stack trace:
#0 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/illuminate/support/Traits/ForwardsCalls.php(36): Illuminate\Database\Eloquent\Model::throwBadMethodCallException('formatContent')
#1 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/illuminate/database/Eloquent/Model.php(1610): Illuminate\Database\Eloquent\Model->forwardCallTo(Object(Illuminate\Database\Eloquent\Builder), 'formatContent', Array)
#2 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/flarum/core/src/Database/AbstractModel.php(202): Illuminate\Database\Eloquent\Model->__call('formatContent', Array)
#3 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/v17development/flarum-seo/src/Managers/Discussion.php(101): Flarum\Database\AbstractModel->__call('formatContent', Array)
#4 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/v17development/flarum-seo/src/Managers/Discussion.php(41): V17Development\FlarumSeo\Managers\Discussion->createTags()
#5 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/v17development/flarum-seo/src/Listeners/PageListener.php(150): V17Development\FlarumSeo\Managers\Discussion->__construct(Object(V17Development\FlarumSeo\Listeners\PageListener), Object(Flarum\Discussion\DiscussionRepository), '1433-s2-ep27-bl...')
#6 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/v17development/flarum-seo/src/Listeners/PageListener.php(116): V17Development\FlarumSeo\Listeners\PageListener->determine()
#7 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/flarum/core/src/Frontend/Frontend.php(63): V17Development\FlarumSeo\Listeners\PageListener->__invoke(Object(Flarum\Frontend\Document), Object(Zend\Diactoros\ServerRequest))
#8 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/flarum/core/src/Frontend/Frontend.php(55): Flarum\Frontend\Frontend->populate(Object(Flarum\Frontend\Document), Object(Zend\Diactoros\ServerRequest))
#9 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/flarum/core/src/Frontend/Controller.php(32): Flarum\Frontend\Frontend->document(Object(Zend\Diactoros\ServerRequest))
#10 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/flarum/core/src/Http/RouteHandlerFactory.php(38): Flarum\Frontend\Controller->handle(Object(Zend\Diactoros\ServerRequest))
#11 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/flarum/core/src/Http/Middleware/DispatchRoute.php(65): Flarum\Http\RouteHandlerFactory->Flarum\Http\{closure}(Object(Zend\Diactoros\ServerRequest), Array)
#12 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\Http\Middleware\DispatchRoute->process(Object(Zend\Diactoros\ServerRequest), Object(Closure))
#13 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/kilowhat/flarum-ext-wordpress/src/Middlewares/LogoutOverrideMiddleware.php(16): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#14 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/zendframework/zend-stratigility/src/Next.php(60): Kilowhat\Wordpress\Middlewares\LogoutOverrideMiddleware->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#15 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/kilowhat/flarum-ext-wordpress/src/Middlewares/LoginWarningMiddleware.php(21): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#16 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/zendframework/zend-stratigility/src/Next.php(60): Kilowhat\Wordpress\Middlewares\LoginWarningMiddleware->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#17 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/kilowhat/flarum-ext-wordpress/src/Embed/WordpressEmbedNotFoundMiddleware.php(18): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#18 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/zendframework/zend-stratigility/src/Next.php(60): Kilowhat\Wordpress\Embed\WordpressEmbedNotFoundMiddleware->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#19 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/flarum/core/src/Http/Middleware/ShareErrorsFromSession.php(56): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#20 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\Http\Middleware\ShareErrorsFromSession->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#21 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/flarum/core/src/Http/Middleware/SetLocale.php(50): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#22 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\Http\Middleware\SetLocale->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#23 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/flarum/core/src/Http/Middleware/CheckCsrfToken.php(23): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#24 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\Http\Middleware\CheckCsrfToken->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#25 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/flarum/core/src/Http/Middleware/AuthenticateWithSession.php(32): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#26 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\Http\Middleware\AuthenticateWithSession->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#27 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/flarum/core/src/Http/Middleware/RememberFromCookie.php(51): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#28 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\Http\Middleware\RememberFromCookie->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#29 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/flarum/core/src/Http/Middleware/StartSession.php(61): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#30 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\Http\Middleware\StartSession->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#31 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/flarum/core/src/Http/Middleware/CollectGarbage.php(46): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#32 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\Http\Middleware\CollectGarbage->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#33 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/flarum/core/src/Http/Middleware/ParseJsonBody.php(28): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#34 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\Http\Middleware\ParseJsonBody->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#35 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/flarum/core/src/Http/Middleware/HandleErrors.php(57): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#36 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\Http\Middleware\HandleErrors->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#37 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/zendframework/zend-stratigility/src/MiddlewarePipe.php(83): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#38 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/middlewares/request-handler/src/RequestHandler.php(84): Zend\Stratigility\MiddlewarePipe->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#39 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/zendframework/zend-stratigility/src/Next.php(60): Middlewares\RequestHandler->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#40 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/middlewares/base-path-router/src/BasePathRouter.php(97): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#41 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/zendframework/zend-stratigility/src/Next.php(60): Middlewares\BasePathRouter->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#42 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/zendframework/zend-stratigility/src/Middleware/OriginalMessages.php(41): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#43 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/zendframework/zend-stratigility/src/Next.php(60): Zend\Stratigility\Middleware\OriginalMessages->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#44 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/middlewares/base-path/src/BasePath.php(53): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#45 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/zendframework/zend-stratigility/src/Next.php(60): Middlewares\BasePath->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#46 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/zendframework/zend-stratigility/src/MiddlewarePipe.php(83): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#47 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/zendframework/zend-stratigility/src/MiddlewarePipe.php(72): Zend\Stratigility\MiddlewarePipe->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\EmptyPipelineHandler))
#48 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/zendframework/zend-httphandlerrunner/src/RequestHandlerRunner.php(95): Zend\Stratigility\MiddlewarePipe->handle(Object(Zend\Diactoros\ServerRequest))
#49 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/vendor/flarum/core/src/Http/Server.php(44): Zend\HttpHandlerRunner\RequestHandlerRunner->run()
#50 /var/www/vhosts/phenomlab.com/forum.phenomlab.com/index.php(22): Flarum\Http\Server->listen()
#51 {main}
Thanks
[deleted] I'll take a look ASAP.
I'm pretty sure it's a side effect of the last update. The SEO extension is probably reading the first post and expecting it to be a comment post, but just like with the other issues discussed above a Wordpress Summary isn't a plain text post.
Hopefully I can solve that by implementing the missing functions That a comment would have.
Technically it's the fault of the SEO extension for not checking the post is a comment before treating it like one