Extension talk:BlogPage

Jump to navigation Jump to search

About this board

Error creating Blog posts (not sure if this should go in social) [1.34]

4
Vapblack (talkcontribs)

Greetings.


So I've recently upgraded my mediawiki and have been overhauling a lof of the backend.

When trying to get the social extentions up again everything looks good until I do one of two things

1: if I load the extensions that I use-

wfLoadExtension( 'BlogPage' );

wfLoadExtension( 'Comments' );

wfLoadExtension( 'VoteNY' );


and I try to look at any of the blogs I previously made I get the following error:

Database error (page title)


A database query error has occurred. This may indicate a bug in the software.

[f655cda325d32fdaad3b57a0] /afropedia/Blog:Life_on_The_Open-Air_Plantation_Aint_Equal Wikimedia\Rdbms\DBQueryError from line 1603 of /var/www/worldafropedia/wiki/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?

Query: SELECT Comment_Username,Comment_IP,Comment_Text,Comment_Date,Comment_Date AS timestamp,Comment_user_id,CommentID,Comment_Parent_ID,vote1.Comment_Vote_Score AS current_vote,SUM(vote2.Comment_Vote_Score) AS comment_score,stats_total_points FROM `user_stats` LEFT JOIN `Comments` ON ((Comment_user_id = stats_user_id)) LEFT JOIN `Comments_Vote` `vote1` ON ((vote1.Comment_Vote_ID = CommentID) AND vote1.Comment_Vote_Username = 'Kofi') LEFT JOIN `Comments_Vote` `vote2` ON ((vote2.Comment_Vote_ID = CommentID)) WHERE Comment_Page_ID = '19004' GROUP BY CommentID

Function: CommentsPage::getComments

Error: 1054 Unknown column 'stats_user_id' in 'on clause' (localhost)


If I try to make a new blog post I get:

[013afee92b964d8e9669368f] /afropedia/Special:CreateBlogPost TypeError from line 142 of /var/www/worldafropedia/wiki/includes/page/WikiPage.php: Argument 1 passed to WikiPage::factory() must be an instance of Title, null given, called in /var/www/worldafropedia/wiki/extensions/BlogPage/includes/specials/SpecialCreateBlogPost.php on line 105

Backtrace:


2: if I disable everything except BlogPage:



and I try to look at any of the blogs I previously made, I the load.


If I try to make a new blog post I get:

[ba6d8b074deed09cf90d9a9a] /afropedia/Special:CreateBlogPost TypeError from line 142 of /var/www/worldafropedia/wiki/includes/page/WikiPage.php: Argument 1 passed to WikiPage::factory() must be an instance of Title, null given, called in /var/www/worldafropedia/wiki/extensions/BlogPage/includes/specials/SpecialCreateBlogPost.php on line 105




Jack Phoenix (talkcontribs)

This is related to the recent changes related to actor support in all social tools. The correct solution here is to upgrade your copy of SocialProfile (and/or any and all other social tools you have, e.g. BlogPage, Comments, VoteNY), to the latest (master) version and rerun maintenance/update.php, the MediaWiki core updater script, after doing that. Note that:

  1. you may want to make a backup of your database prior to doing this, just in case, for there are some scary internal changes
  2. currently social tools support only MediaWiki 1.34; older versions of MW are considered unsupported and newer ones may or may not work (but it doesn't matter because MW 1.35 hasn't been released yet)
Vapblack (talkcontribs)

Thanks for your reply. I uploaded the new extensions and ran the maintenance/update.php and the same errors are there.

I can only *see* old blog posts if I disable every social extension but BlogPage, and I can't post a new blog entry under any circumstances.



___________________________________


EDIT: Actually, I realized I didn't download the master files, so I just did that, reuploaded, ran php update.php and got the following:

...user_system_messages table already exists.

...user_points_weekly table already exists.

...user_points_monthly table already exists.

...user_points_archive table already exists.

...user_stats table does not contain stats_year_id field.

...user_profile table does not contain up_last_seen field.

...Comments table already exists.

...Comments_Vote table already exists.

...Comments_block table already exists.

Adding Comment_actor field to table Comments ...done.

Adding index wiki_actor to table Comments ...done.

Running /var/www/worldafropedia/wiki/extensions/Comments/includes/../sql/../maintenance/migrateOldCommentsUserColumnsToActor.php...

done.

Table Comments contains Comment_user_id field. Dropping ...done.

Table Comments contains Comment_Username field. Dropping ...done.

...wiki_user_id key doesn't exist.

...wiki_user_name key doesn't exist.

Adding cb_actor field to table Comments_block ...done.

Adding cb_actor_blocked field to table Comments_block ...done.

Adding index cb_actor to table Comments_block ...done.

Running /var/www/worldafropedia/wiki/extensions/Comments/includes/../sql/../maintenance/migrateOldCommentsBlockUserColumnsToActor.php...

done.

Table Comments_block contains cb_user_id field. Dropping ...done.

Table Comments_block contains cb_user_name field. Dropping ...done.

Table Comments_block contains cb_user_id_blocked field. Dropping ...done.

Table Comments_block contains cb_user_name_blocked field. Dropping ...done.

...cb_user_id key doesn't exist.

Adding Comment_Vote_actor field to table Comments_Vote ...done.

Adding index Comments_Vote_actor_index to table Comments_Vote ...Wikimedia\Rdbms\DBQueryError from line 1603 of /var/www/worldafropedia/wiki/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?

Query: CREATE UNIQUE INDEX Comments_Vote_actor_index ON `Comments_Vote` (Comment_Vote_ID,Comment_Vote_actor)

Function: Wikimedia\Rdbms\Database::sourceFile( /var/www/worldafropedia/wiki/extensions/Comments/includes/../sql/patches/actor/add-Comment_Vote_unique_actor_index.sql )

Error: 1062 Duplicate entry '1-0' for key 'Comments_Vote_actor_index' (localhost)


after disabling comments, I ran the updater again and there were no errors.


Still same same inability to create new blog posts though


EDIT2: After deleting the extensions and downloading the master versions and installing them again, everything worked save for creating a new blog entry. The error involved VOTENY, so I downloaded the 1.34 stable version (1a78517 of the VoteNY extension for MediaWiki REL1_34 ) After that, almost everything is good.

One small problem though, my old blog entries dont say who created them.

at the top, they simply say by created 14:50, March 2, 2019 , last edited 21:54, March 2, 2019

whereas the new blog post I just made say:

by Vapblack created 16:05, February 1, 2020

thanks for the help

Jack Phoenix (talkcontribs)

Well, using the release branches (instead of master) of the social tools extensions is simply not supported, so you're on your own in that regard, I'm afraid. The existence of those branches is problematic because they are created automatically by the people handling MediaWiki releases, but I don't maintain them, so they are guaranteed to be outdated literally 100% of the time, so it's pure luck if they work or not.

Anyway, back to the original issue...

Seems like you've managed to find a tricky and annoying bug with the actor migration scripts: the Comments' migration scripts (and same for other social tools extensions, I'm afraid) don't handle a particular edge case at all. In this case, the edge case is "(anonymous) user has posted a comment (or comments) but has not performed any other actions on the wiki". The migration scripts incorrectly assume that there is a corresponding entry for every user in the actor table; but in this edge case, this isn't necessarily the case. The scripts should be able to identify these cases and create actor entries when those entries don't yet exist, but currently that is unfortunately not the case. I can't promise you a definitive ETA, but I'm hoping to get this fixed during March 2020 if not sooner.

Reply to "Error creating Blog posts (not sure if this should go in social) [1.34]"
AlgorithmGG (talkcontribs)

HI,


it seems as though commenting is broken on the blog posts. nothing is happening when user clicks the button to post the comment.

Jack Phoenix (talkcontribs)

The commenting functionality is provided by Extension:Comments. Regardless, the social tools are currently undergoing pretty major architectural changes to support the new actor table and the general concept of actors. See phab:T227345 for more technical details.

The issue you're describing sounds like a JavaScript error of some kind. I haven't seen any such JS errors in my devboxes. Is your wiki public so I could take a look at it?

Regardless, I suggest checking back by, say, the end of January or so; I hope the actor migration stuff has been mostly done by that point. (But if you'll look at the mentioned Phabricator ticket, you'll see that Comments and SocialProfile are some of the trickiest extensions to port over. Regardless, using actor IDs instead of traditional user ID/user name combos provides benefits like eventually being able to support user renaming on ShoutWiki, hence why that is being done now.) At that point all the social tools should support actors and work on MediaWiki 1.34 as expected.

AlgorithmGG (talkcontribs)
AlgorithmGG (talkcontribs)

Excuse my wiki its a mess at the moment as I am trying to figure out how to add a top ten language circle.

Jack Phoenix (talkcontribs)

No worries. So, looking at https://g1pedia.com/index.php/Special:Version, seems that you have the MobileFrontend extension (and its companion, the MinervaNeue skin) installed; it's a popular solution for providing a mobile experience of sorts, and was developed and is also maintained by the Wikimedia Foundation. While both the MobileFrontend extension and the MinervaNeue skin are thus quite stable, they do some things which at least I consider odd. Namely that extensions' CSS and JS ResourceLoader modules aren't loaded unless they are explicitly marked as "OK for mobile", i.e. the module definition has a targets array which specifies mobile (and optionally also desktop) as a valid target. Comments' both RL modules do specify both targets (in the extension.json file), so I'm not sure what's going on there.

BlogPage's RL modules don't specify targets, which probably in practise means with that the MobileFrontend view (which you can activate by appending ?mobileaction=toggle_view_mobile to the page URL) BlogPage's special pages look funky and don't quite work right as the CSS and JS isn't loaded. Commenting shouldn't be affected as BlogPage literally uses Comments for that instead of doing anything related to commenting on its own.

That being said, I can safely say that I've really not tested the MobileFrontend+MinervaNeue+social tools combo, so in that respect, all bets are off. Furthermore as none of the social tools are used on Wikimedia Foundation wikis, it means that WMF developers most likely haven't tested the combination either.

Seeing that you have the awesome, responsive, actively developed Timeless skin already installed, I'd consider whether you have a pressing need for MobileFrontend and MinervaNeue and the features they provide. If you choose to uninstall those two and set Timeless as the default skin, it should provide a similar-ish mobile experience without the usual MobileFrontend-specific content transformations and the like.

You can also try contacting the maintainers of MobileFrontend and MinervaNeue, Wikimedia Foundation's Reading Web team and specifically Jon Robson, to see what they have to say about this.

To clarify my stance on this: this certainly sounds like a software bug of sorts and something that'd be nice to get fixed. But I can't promise an ETA of any kind on a fix, as I don't quite fully understand what's going on here (code-wise) nor do I have time to work on this right now; the aforementioned actor migration stuff is honestly a nightmare and a time-consuming one, so I fully expect that to keep me busy at least for the next couple weeks or so.

AlgorithmGG (talkcontribs)

Many thanks for your reply. Do we know what framework is used to make it mobile friendly for example (bootstrap)? its not bootstrap but it would be handy to know what language the button is written in as to why its not translated and functioning on mobile view. I am not sure if you have seen how its working but other than the post buttons not being translated. It is ready to work and looks awesome.

Jdlrobson (talkcontribs)

Use MobileFrontend if you want to serve different experiences to mobile and desktop users and optimise the experience.

Using MobileFrontend you'll have a more performant, controllable and in some cases more usable mobile experience.

The downside is many extensions are not compatible with MobileFrontend. The targets system was written intentionally to avoid the running of code that hadn't been integrated with the extension. This avoids loading code that's not needed in the given context or hasn't been tested in the existing device.

ResourceLoader/Writing a MobileFrontend friendly ResourceLoader module is pretty thorough on the why and the how extension owners can integrate with MobileFrontend.

In this case it's not a Wikimedia extension so you could probably turn on all the modules it uses with a mobile target but I cant promise the experience will be completely usable.

Note Minerva has nothing to do with this. It's just a skin like Monobook, Timeless and Vector.

AlgorithmGG (talkcontribs)

thanks I've noticed a few issues with social tools I.e sending messages board to board the send button is broken. It looked like a php html issue to me this function was only broken on the mobile app. Is it possible to add flow to the user board namespace at present? Exciting stuff!


Kind Regards

Jack Phoenix (talkcontribs)

There's no such support for integrating with Flow, alas. The closest related ticket on Phabricator is phab:T167312 which is about integrating SocialProfile avatars with Flow; feel free to submit a new task on Phabricator! (That being said, full disclaimer: I don't know how likely it'd be for such a ticket to get fixed at least in a reasonable timeframe. As per its own infopage here, Flow's been in maintenance mode since 2015 and I haven't looked at how complicated it would be to have user boards or other similar textareas use Flow. At least Comments is finally getting a preview feature; long overdue, but better late than never.)

AlgorithmGG (talkcontribs)

Do you know of any information, I can study you would recommend please. I have a long flight coming up soon this month. And I would like to get a thorough understanding of how the scripts and extensions are working together.



Reply to "mediawiki 1.34 commenting"

how to change simple editor to rich editor in textarea

2
58.244.94.51 (talkcontribs)

how to change simple editor to rich editor in textarea

Jack Phoenix (talkcontribs)

What do you mean by "rich editor"? VisualEditor? WikiEditor? Something else? Anyway, there's currently no built-in support for such a thing in any case, and as always, patches are welcome.

Reply to "how to change simple editor to rich editor in textarea"

"Cannot use object of type Comment as array"

3
Summary by Ciencia Al Poder
C veronesi horta (talkcontribs)

Hello, I'm testing the BlogPage extension with Mediawiki 1.29.0, PHP 5.5.14 and Comments 4.2.1.

Everytime I save a new article I get this fatal error:

[Fri Aug 25 10:19:23.682888 2017] [php5:error] [pid 60677] [client xxx.xxx.xxx.xxx:34360] PHP Fatal error:  Cannot use object of type Comment as array in /usr/local/mediawiki/testwiki/extensions/BlogPage/BlogPageClass.php on line 931, referer: http://xxx.xxx.xxx.xxx/index.php/Speciale:ArticlesHome

The article seems to be saved anyway but when I try to open it I get the same error.

Is my PHP version too old?

C veronesi horta (talkcontribs)

I fixed the problem by applying the solution indicated in the post below, i.e. disabling comments of the day.

223.101.0.110 (talkcontribs)

how?

Reply to ""Cannot use object of type Comment as array""
Krayfishkarl (talkcontribs)

I'm getting the screen "A database query error has occurred. This may indicate a bug in the software" whenever someone tries to view a blog page on my site. Enabling the debug info, I get the message: Error: 1054 Unknown column 'Comment_Plus_Count' in 'field list'

I'm aware that there was a bug like this some time ago, but I just installed the master development version for the blog page and comments extension, so any idea what's going on here?

PatHube (talkcontribs)

I get the same error, any advice? I looked at the sql script from the Comments extension and it doesn't create this 'comment_Plus_Count' column when creating the table Comments, so could that mean the Comments extension is responsible for this error?

PatHube (talkcontribs)

I changed the value to false on line 96 in Blog.php and it solved it. This means it won't show the "Comments of the day" but at least it's working now!

 'comments_of_day' => false,
Dariomarcelino (talkcontribs)

Thanks for sharing the fix, it helped me solve my problem. I'm using MW 1.28 and now this setting has moved to extension.json. So the fix should look like this:

extensions/BlogPage/extension.json:36:  "comments_of_day": false,
193.105.251.4 (talkcontribs)

From Extension:Comments. It should be added to BlogPage docs...

The extension also comes with a "Comments of the Day" feature (<commentsoftheday />), which by default is not enabled. You can enable this feature in the wiki's LocalSettings.php, by adding the following after the require_once line:

require_once "$IP/extensions/Comments/CommentsOfTheDay.php";
Reply to "Error 1054"
115.42.188.18 (talkcontribs)

creation etc all are ok, but opening any blog posts shows the below error.

A database query error has occurred. This may indicate a bug in the software.

Notice: Uncommitted DB writes (transaction from DatabaseBase::query (WikiPage::pageData)). in .......\includes\db\Database.php on line 4262

Notice: JobQueueGroup::__destruct: 1 buffered job(s) of type(s) EnqueueJob never inserted. in ..........\includes\jobqueue\JobQueueGroup.php on line 420

Please provide some assistance

Onesimok (talkcontribs)

Was experiencing the same. The answer above to question 'Error 1054' solved my problem. Please check it out.

Reply to "error"

Database error - JobQueueGroup::__destruct

1
Summary by Onesimok

Followed instructions below about changing line 96 in /extensions/BlogPage/Blog.php to false

 'comments_of_day' => false,
Onesimok (talkcontribs)

On attempting to view the blog posts, one gets:

A database query error has occurred. This may indicate a bug in the software.


Notice: JobQueueGroup::__destruct: 1 buffered job(s) of type(s) EnqueueJob never inserted. in /home/pindula/public_html/includes/jobqueue/JobQueueGroup.php on line 420


I enabled SQL debugging and now I get:

A database query error has occurred. This may indicate a bug in the software.
Query:
SELECT Comment_Username,comment_ip,comment_text,comment_date,Comment_user_id,CommentID,IFNULL(Comment_Plus_Count - Comment_Minus_Count,0) AS Comment_Score,Comment_Plus_Count AS CommentVotePlus,Comment_Minus_Count AS CommentVoteMinus,Comment_Parent_ID,page_title,page_namespace FROM `Comments`,`page` WHERE (comment_page_id = page_id) AND (UNIX_TIMESTAMP(comment_date) > 1463817075) AND page_namespace = '500' ORDER BY Comment_Plus_Count DESC LIMIT 5
Function: BlogPage::getCommentsOfTheDay
Error: 1054 Unknown column 'Comment_Plus_Count' in 'field list' (localhost)

Notice: Uncommitted DB writes (transaction from DatabaseBase::query (WikiPage::pageData)). in /home/pindula/public_html/includes/db/Database.php on line 4262

Notice: JobQueueGroup::__destruct: 1 buffered job(s) of type(s) EnqueueJob never inserted. in /home/pindula/public_html/includes/jobqueue/JobQueueGroup.php on line 420

Please help

220.233.17.248 (talkcontribs)

I'mm getting a malformed "by" line it looks like it should be

Authorname

oddly when rendered I'm seeing

Authorname]][[Category:6th January 2015

Anyone else seeing this?

Wiki version 1.24.1

220.233.17.248 (talkcontribs)

sigh edit wont work

used the wrong tags on line2


[[Authorname]][[category:Date Published]]
Colin2030 (talkcontribs)

I'm getting this too.

Is there a fix please?

Thanks

2A02:8108:2700:1E14:C090:8DE8:98DF:A89 (talkcontribs)

I have this problem and know how to also solve it. It probably has something to do with the BlogPage.php file, but what needs to be done there.

Do you know that? Would be very grateful for any help.

158.222.249.207 (talkcontribs)

I'm getting this too. Usually fix it by editing the categories and putting the date on the line below. I would like that to be automatic tho.

Jack Phoenix (talkcontribs)

Are you running the latest version of BlogPage? I fixed a bug which sounds awfully lot like this one last December.

Vapblack (talkcontribs)

Took some months but I finally realized that I have to go there and apply the little change that you made. Good work it was easy. Please keep updating and adding functionality. I wish I could assist. ~~~~

Vapblack (talkcontribs)

Yes, unless 2.2 isn't the latest.

Reply to "Malformed "by" line"

don't work with mediawiki 1.19.0

2
Hevercking~mediawikiwiki (talkcontribs)

Hi i using mediawiki 1.19.0, i have installed SocialProfile,Comments and VoteNY extensions but when i try create new blog says this message

Warning: Invalid argument supplied for foreach() in /var/www/mediawiki/mediawiki3/extensions/SocialProfile/UserStats/UserStatsClass.php on line 611

Ha ocurrido un error de sintaxis en una consulta a la base de datos. Esto puede indicar un error en el software. La última consulta a la base de datos que se intentó fue: (Consulta SQL oculta) dentro de la función «UserStatsTrack::updateWeeklyPoints». La base de datos devolvió el error «1146: Table 'mediawiki3.wiki_user_points_weekly' doesn't exist (localhost)».

I search in the code the sql code but i can't found it.

Any solution?

This post was posted by Hevercking~mediawikiwiki, but signed as Hevercking.

Jack Phoenix (talkcontribs)

To be specific, it's not an extension bug per se, but rather a problem with your configuration. You have set (at least) $wgUserStatsTrackWeekly to true without creating the necessary database table(s); the schemas for user_points_weekly, user_points_monthly and user_points_archive are located in Extension:RandomFeaturedUser's directory on SVN (yes, SVN, as opposed to git).
Create those tables by running something line this (for each different file) from command line: php path/to/your/wiki/maintenance/sql.php path/to/your/wiki/extensions/RandomFeaturedUser/user_points_weekly.sql

Reply to "don't work with mediawiki 1.19.0"
Peachey88 (Flood) (talkcontribs)
Jack Phoenix (talkcontribs)

ExtensionDistributor seems to be broken, once again. You can either download a SVN client or download the files on a one-by-one basis via ViewVC.

Reply to "Unable to download with ED"