Project:Support desk

Jump to navigation Jump to search

About this board

Welcome to the MediaWiki Support desk, where you can ask MediaWiki questions!

(Read this message in a different language)

See also

Other places to ask for help:

Before you post

Post a new question

  1. To help us answer your questions, please indicate which versions you are using, as found on your wiki's Special:Version page:
    • MediaWiki version
    • PHP version
    • Database type and version
  2. Please include the web address (URL) to your wiki if possible. It's often easier for us to identify the source of the problem if we can see the error directly.
  3. To start a new thread, click "Start a new topic".

Hook SkinBuildSidebar not working in MW_1_35

12
Goodman Andrew (talkcontribs)

What I did:

$wgHooks['SkinBuildSidebar'][] = function($skin, &$bar) {
        $out = <<< EOT
<iframe src="//rcm-na.amazon-adsystem.com/e/cm?o=1&p=29&l=ur1&category=software&banner=0FNP2ZP63JZJBWQRD082&f=ifr&linkID=ea3dcccece96f5ba66814f531937489c&t=example-20&tracking_id=example-20" width="120" height="600" scrolling="no" border="0" marginwidth="0" style="border:none;" frameborder="0"></iframe>
EOT;
        $out .= "<script>$('#p-Ads').addClass('persistent');</script>";
        $bar['Ads'] = $out;
        return true;
};

The intended ads isn't showing.

even the following example has no effect on the wiki in question:

$wgHooks['SkinBuildSidebar'][] = function( $skin, &$bar ) {
	$bar['navigation'][] = [
		'text'  => $skin->msg( 'wikimediashoplink-linktext' ),
		'href'  => '//shop.wikimedia.org',
		'title' => $skin->msg( 'wikimediashoplink-link-tooltip' ),
		'id'    => 'n-shoplink',
	];
};

Please advise.

MarkAHershberger (talkcontribs)

Which skin are you using?

Goodman Andrew (talkcontribs)

@MarkAHershberger: Default skin Vector on desktop and Minerva Neu on Mobile Frontend.

Any trouble that might caused?

@Bawolff: what can you say about this ?

Bawolff (talkcontribs)

I can say that Mark is correct.

Goodman Andrew (talkcontribs)

Maybe it's MW_1_35 ish because this code works on the default vector skin on 1_33 before we upgraded MW.

Can anyone with MW_1_33 please confirmed this?

MarkAHershberger (talkcontribs)

The SkinBuildSidebar hook is invoked by the skins, so the skin you are using matters. I would have to look more closely to tell you any more.

Goodman Andrew (talkcontribs)

Good. Please carefully experiment from your end because even the examples at the hook page didn't have any effect on the wiki in question.

MarkAHershberger (talkcontribs)

I am not sure I really have time to look at your issue.

However, one thing you said makes me wonder: Are you using the version of the Vector skin that comes with MediaWiki 1.35 or are you still using the 1.33 version of Vector?

Goodman Andrew (talkcontribs)

This is not funny. Everyone knows that when you update MW you need to update all extensions as well.

Why would someone use an old skin on a new MW?

@Ammarpad: please help me out here.

Ammarpad (talkcontribs)

I am not sure what to say apart from what has been said. If you think there's a bug, you can file a bug report

Goodman Andrew (talkcontribs)

Please I need someone to also test that code from her end and see if it works.

Have anyone tested already?


Even though I increased the size of the sidebar to comfortably accommodate a 120x600 (vertical) banner and even a 160x600, it still doesn't work:

/* All CSS here will be loaded for users of the Vector skin */

/* increase Vector sidebar width to accommodate ads */
div#mw-panel { width: 12em; }
div#p-Ads div.body {margin: 0em !important; }
div#footer, #mw-head-base, div#content { margin-left: 12em; }
#left-navigation { margin-left: 12em; }
Goodman Andrew (talkcontribs)

I've confirmed it with MW_1_33, it works. There's a bug🐜 that's preventing it from working in 1_35.

Please someone should help report the bug to the correct quarters.

Thank you.

Reply to "Hook SkinBuildSidebar not working in MW_1_35"

"Unable to run external programs, proc_open() is disabled. Error code: 1"

8
Novike (talkcontribs)

How do I fix the bug?

Malyacko (talkcontribs)
Novike (talkcontribs)

@Malyacko update user set user_touched='20200316120000' where hex(user_touched)='0000000000000000000000000000'; ?

Is that enough code? The site later collapsed

Malyacko (talkcontribs)

@Novike: Errm, what has some user database stuff to do with proc_open ?

Novike (talkcontribs)

I do not know

Malyacko (talkcontribs)
Novike (talkcontribs)

I can send a snapshot of the LocalSettings.php file on the server

Malyacko (talkcontribs)
Reply to ""Unable to run external programs, proc_open() is disabled. Error code: 1""

Problem creating images. This is an error

11
Novike (talkcontribs)

If I upload an image server it makes a mistake and is not seen. In contrast, images from Wikimedia Commons do work. Does anyone know?

Malyacko (talkcontribs)

How exactly do you upload? What is the mistake? What is the website? What does the web server error log show? What do the web browser's developer tools show? What are clear steps to reproduce? Which MediaWiki version is this about? Please see the sidebar - thanks! :)

Novike (talkcontribs)

The version is 1.35.1 I do not understand that. You can see the site at this link

Malyacko (talkcontribs)

Hi, please also answer the other questions. I could not see the site at that link, as it first required to allow storing cookies in my browser. That website link shows an image of the Wikimedia Commons logo. If it does not for you, then see my previous question: What do the web browser's developer tools show?

Novike (talkcontribs)

I do not know. I started working with the software a few days ago

Novike (talkcontribs)
Malyacko (talkcontribs)

See the error message on that page. It says: שגיאה ביצירת תמונה ממוזערת: Unable to run external programs, proc_open() is disabled. Error code: 1

Novike (talkcontribs)

Upload an image like any regular media wiki site. The software version is the newest.

Malyacko (talkcontribs)
Novike (talkcontribs)
Malyacko (talkcontribs)
Reply to "Problem creating images. This is an error"

About JavaScript date.now() function , Wikipedia said 60 % php , 40% from JavaScript

12
藥物介紹義工 (talkcontribs)

Help

Can you test from your any computer or phone to view any page from official Wikipedia . then view your server log record , the time stamp is form computer local time or sever utc time?

But first please change your phone or computer time clock , set to fast 5 minutes or more.

Thanks

Ciencia Al Poder (talkcontribs)
藥物介紹義工 (talkcontribs)

Wikipedia server is use JavaScript , i need clearly to know when i view any web page from Wikipedia server log record is save my access computer local clock ? or use Wikipedia utc clock.

Can you help me .

I send Wikimedia Answers email and Wikipedia Volunteer .

Volunteer email said server log save record is for Wikipedia utc , not my computer time

Wikimedia Answers said me go to this to request my problem.

藥物介紹義工 (talkcontribs)

Hello

This 100% is about official Wikipedia , because my problem about law , when anyone view Wikipedia web page . The time stamp have or not Will it be affected by the JavaScript time function , server log records is save my computer local clock ? or use Wikipedia utc clock.

Ciencia Al Poder (talkcontribs)

Anything saved/stored on the server uses the server time, not JavaScript time. Dates on the server are stored using UTC timezone. However, dates displayed on browser may be adjusted to a different timezones depending on user preferences, and in case of unregistered users, it will use the configured server's timezone (usually UTC, but may be different on different wikis)

藥物介紹義工 (talkcontribs)

Ok , thanks for your help first


But my question is not about register or unregistered to edit Wikipedia web page is or not the time stamp it will be affected by the JavaScript date.now() time function .


Ok finally

eg: i come to this url read this page Wikipedia, server log record is save my access computer local clock time stamp ? or use server utc clock time stamp. No any affected by the JavaScript date.now() time function .


https://zh.m.wikipedia.org/wiki/HoneyWorks


Thanks

Ciencia Al Poder (talkcontribs)

What server log are you talking about? The link you pointed at is a normal page, not a log

藥物介紹義工 (talkcontribs)

Normal page have log .

From

server /var/log/apache/access.log have save anyone records ip , date , time .

But media wiki program have use date.now() time function by Wikipedia Volunteer said that , so anyone only read this normal page , the server log record is save my computer local clock time stamp ? or use server utc clock time stamp. No any affected by the JavaScript date.now() time function ?

Please focus and come back to system access.log

Thanks

Ciencia Al Poder (talkcontribs)

I do not have access to Wikimedia Foundation's servers to see the contents of the apache access log.

Apparently, the default configuration for access logs is to display the server's timezone:

https://httpd.apache.org/docs/2.4/logs.html#accesslog

Again, this is not specific to MediaWiki.

藥物介紹義工 (talkcontribs)

Hello thank you .

How can contact Chinese server owner?

Thanks

Ciencia Al Poder (talkcontribs)
Malyacko (talkcontribs)
Reply to "About JavaScript date.now() function , Wikipedia said 60 % php , 40% from JavaScript"
Onmiy (talkcontribs)

Hello,


when you upload a data/ picture ana changes can be tracked on a page called "Data:Name.xyz"


My question is: Is it possible to change the design of the table, which is on this page? Instead of "Version from", I would rename this column to "uploaded at" or put one more column into it.


YOuld be great if anyone can help.

Thanks

Reply to "Date Version"
Johnywhy (talkcontribs)

/public_html/maintenance$ php dumpBackup.php

Notice: Undefined index: hideroot in /home/gunsywtx/public_html/LocalSettings.php on line 288

...

php dumpBackup.php --full > dump.xml

> 2021-01-26 22:44:52: gunsywtx_gunsens (ID 751163) 0 pages (0.0|0.0/sec all|curr), 100 revs (317.2|317.2/sec all|curr), ETA 2021-01-26 22:45:08 [max 5171]

2021-01-26 22:44:52: gunsywtx_gunsens (ID 751163) 0 pages (0.0|0.0/sec all|curr), 200 revs (477.3|964.1/sec all|curr), ETA 2021-01-26 22:45:02 [max 5171]

...

2021-01-26 22:44:55: gunsywtx_gunsens (ID 751163) 214 pages (65.4|2368.1/sec all|curr), 3100 revs (948.1|1106.6/sec all|curr), ETA 2021-01-26 22:44:57 [max 5171]

2021-01-26 22:44:55: gunsywtx_gunsens (ID 751163) 227 pages (68.6|5817.0/sec all|curr), 3151 revs (952.3|1306.9/sec all|curr), ETA 2021-01-26 22:44:57 [max 5171]

> Command `php dumpBackup.php --full > dump.xml` failed with return code 0 and error

Malyacko (talkcontribs)

See the notice message.

Johnywhy (talkcontribs)

Which notice message? i don't understand the problem. thx

Malyacko (talkcontribs)

@Johnywhy See Notice: Undefined index: hideroot in /home/gunsywtx/public_html/LocalSettings.php on line 288

Have you checked that file around its line 288? What is there, and why?

Johnywhy (talkcontribs)

i commented the problem line in LocalSettings.php. Not getting that error anymore.

But dumpBackup still failing.

php dumpBackup.php --full > dump.xml

> 2021-01-26 22:44:52: gunsywtx_gunsens (ID 751163) 0 pages (0.0|0.0/sec all|curr), 100 revs (317.2|317.2/sec all|curr), ETA 2021-01-26 22:45:08 [max 5171]

2021-01-26 22:44:52: gunsywtx_gunsens (ID 751163) 0 pages (0.0|0.0/sec all|curr), 200 revs (477.3|964.1/sec all|curr), ETA 2021-01-26 22:45:02 [max 5171]

...

2021-01-26 22:44:55: gunsywtx_gunsens (ID 751163) 214 pages (65.4|2368.1/sec all|curr), 3100 revs (948.1|1106.6/sec all|curr), ETA 2021-01-26 22:44:57 [max 5171]

2021-01-26 22:44:55: gunsywtx_gunsens (ID 751163) 227 pages (68.6|5817.0/sec all|curr), 3151 revs (952.3|1306.9/sec all|curr), ETA 2021-01-26 22:44:57 [max 5171]

> Command `php dumpBackup.php --full > dump.xml` failed with return code 0 and error

Reply to "dumpBackup.php Fails"

"Permission Error" page appears first instead of the login page

1
Davijsantos (talkcontribs)

When I first log in to Mediawiki the first page that always appears is the "Permission Error" page because I am not logged in. Then I have to click into the authenticate button to go to the login page. I want know if it's possible to go direct to the login page.

Reply to ""Permission Error" page appears first instead of the login page"

Problem with browser back button

4
Summary by Alexandre7411

Do not use window.location.replace() function to do redirection it can mess up the brower history.

Alexandre7411 (talkcontribs)

Hi,

I have a problem with the back button of the browser, the wiki doesn't seem to respect the history correctly and redirects the user in the wrong way.

I have created a video to illustrate this problem that you can watch on youtube at the following link: https://youtu.be/4qE6tJ5w_4A

My wiki to the next version : MediaWiki(1.35.1), PHP7.4.13 (fpm-fcgi)

Thank you in advance for your help

Malyacko (talkcontribs)

Does it work in another browser like Firefox? Does it work when not using private mode?

Alexandre7411 (talkcontribs)

I have tried it on Safari/Firefox/Chrome in private mode and without private mode. The problem still occur every time.

Alexandre7411 (talkcontribs)

Problem with browser back button

5
Summary by Alexandre7411

Do not use window.location.replace() function to do redirection it can mess up the brower history.

Alexandre7411 (talkcontribs)

Hi,

I have a problem with the back button of the browser, the wiki doesn't seem to respect the history correctly and redirects the user in the wrong way.

I have created a video to illustrate this problem that you can watch on youtube at the following link: https://youtu.be/4qE6tJ5w_4A

My wiki to the next version : MediaWiki(1.35.1), PHP7.4.13 (fpm-fcgi)

I have tried it on Safari/Firefox/Chrome in private mode and without private mode. The problem still occur every time.


Thank you in advance for your help

Malyacko (talkcontribs)
Alexandre7411 (talkcontribs)

Since no response was received, I allowed myself to repost the question. I will close this topic as you don't want duplicate

Gib Senf dazu! (talkcontribs)

There are some gadgets and tricky things which may skip or insert one entry in history, especially when a page redirect is executed, but to the benefit of the user. It works fine over many years on millions of redirect pages with all browsers with no complaints of WMF wiki communities. IIRC it is about inserting a &redirect=no URL or to preserve a fragment identifier or something else meaningful.

Alexandre7411 (talkcontribs)

I found the solution to my issue. Some of my buttons were using the javascript window.location.replace() function which the created problem in the browser history. The issue was in my js code, I'm sorry for the inconvenience.

Onmiy (talkcontribs)

Hello,


I would use a wiki with many members. Is it possible to create private areas in wiki, where everyone can upload his own document? They should not visible to others. Or a page, which only selected members can open?


Thanks.

Reply to "Private Areas"