-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add special page to import an entity #25
base: master
Are you sure you want to change the base?
Conversation
I also just noticed that entity imports are done by an IP address (10.68.21.68 in the case of the test wiki mentioned above), not the user that used the special page. That’s fine for my test wiki, but I should also try to fix that before this can be merged. |
If the import script is run from the command line, there is no session, and the edit is still credited to 127.0.0.1. However, if there is a session – for example, if the import is run from a special page (filbertkm#25) – this ensures that the correct user is used.
Not a local bug, happens on wikidata-constraints as well :( apparently, as soon as I import the first entity with statements, |
PR updated – some general refactoring, and also a checkbox for importing statements (disabled so far, but at least this communicates that statements won’t be imported). Still live on wikidata-constraints. |
4791f52
to
7cfe948
Compare
I just noticed that this bypasses all permission checks, since it uses |
If the import script is run from the command line, there is no session, and the edit is still credited to 127.0.0.1. However, if there is a session – for example, if the import is run from a special page (filbertkm#25) – this ensures that the correct user is used.
Special:ImportEntity imports a single entity and then redirects to the imported entity. Two new configuration options are added to provide a human-readable link to the remote Wikibase installation on the special page, in addition to the API URL that the extension needs to actually import the entity. Importing statements does not work properly, since the page_props table is apparently not updated at all anymore once the first attempt to import statements is made. For now, the checkbox to import statements is disabled, and statements are never imported. This commit is not yet ready for merging, since it currently includes two changes to EntityImporterFactory; the change from private to public might be necessary, but the commented-out toplevel statements probably have some better solution.
7cfe948
to
3cb9440
Compare
Special:ImportEntity imports a single entity and then redirects to the imported entity.
Two new configuration options are added to provide a human-readable link to the remote Wikibase installation on the special page, in addition to the API URL that the extension needs to actually import the entity.
Importing statements does not work properly, since the page_props table is apparently not updated at all anymore once the first attempt to import statements is made. For now, the checkbox to import statements is disabled, and statements are never imported.
This commit is not yet ready for merging, since it currently includes two changes to EntityImporterFactory; the change from private to public might be necessary, but the commented-out toplevel statements probably have some better solution.
This is live on wikidata-constraints.wmflabs.org: https://wikidata-constraints.wmflabs.org/index.php/Special:ImportEntity