Last modified: 2014-01-04 22:39:19 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T61204, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 59204 - Properties do not unset on pages in custom namespaces
Properties do not unset on pages in custom namespaces
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
master
All All
: High major (vote)
: ---
Assigned To: Jeroen De Dauw
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-01-02 11:57 UTC by Neill Mitchell
Modified: 2014-01-04 22:39 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Neill Mitchell 2014-01-02 11:57:47 UTC
If you have a property set in a page in a custom namespace, the value does not get unset if the page is subsequently deleted.

Example:
A custom namespace is defined called PRIVATE

define("NS_PRIVATE", 500);
define("NS_PRIVATE_TALK", 501);

$wgExtraNamespaces[NS_PRIVATE] = "Private";
$wgExtraNamespaces[NS_PRIVATE_TALK] = "Private_talk";

I have the namespace defined in $smwgNamespacesWithSemanticLinks

Properties defined in pages in this namespace are set. For 
example:

[[HasTitle::{{{Title|}}}]]

If the page is then deleted, the property remains set with a red link to the deleted page. Correct behaviour should be the property is unset.

Tested on MW 1.22, SMW 1.9 master
Comment 1 Jeroen De Dauw 2014-01-02 23:01:23 UTC
James, this seems to be related to stuff you did - any idea about this?
Comment 2 Jeroen De Dauw 2014-01-02 23:02:27 UTC
Neill, not going to elevate this to 1.9 blocker. I hope this issue gets resolved quickly and that it can go into a subsequent release, which I hope will happen not to far after 1.9.
Comment 3 Neill Mitchell 2014-01-03 11:42:35 UTC
Okay, fair enough Jeroen :)

Hopefully this will get sorted as the problem was introduced in 1.8, so has been around a while now.

Thanks!
Comment 4 MWJames 2014-01-03 11:52:09 UTC
(In reply to comment #1)
> James, this seems to be related to stuff you did - any idea about this?

Mmm, I don't recollect me working on this.

Furthermore I don't really understand the problem. Taken into account the information given I was unable to reproduce an example nor find an appropriate unit test that would allow to create a false positive.
Comment 5 MWJames 2014-01-03 12:33:20 UTC
The code [1], [2] for page deletion does not distinguish between namespaces.

[2] is already mentioning "///FIXME: if a property page is deleted, more pages may need to be updated by jobs!" which might be a reason as to why values being interpret as not being unset. 

[1] https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/includes/Setup.php#L394

[2] https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/includes/storage/SQLStore/SMW_SQLStore3_Writers.php#L53
Comment 6 MWJames 2014-01-03 13:45:07 UTC
Maybe you can test [1] to see if the issue reported above still occurs. You need to run the JobQueue because the clean-up job is expensive therefore relevant updates only happen after the Jobs are done.

[1] https://github.com/SemanticMediaWiki/SemanticMediaWiki/pull/71
Comment 7 Neill Mitchell 2014-01-03 16:54:06 UTC
Thanks for the reply. Okay, I'll pull the master version and test.
Comment 8 Jeroen De Dauw 2014-01-03 17:19:06 UTC
Neill, this is not on master yet. It is currently on the branch named "bug" that is on our GitHub remote.
Comment 9 Jeroen De Dauw 2014-01-03 21:35:08 UTC
Neill, can you test the fix? It is still on the mentioned branch.

If you can do this by tomorrow, the fix will be in the archive linked from the 1.9 rel announce email.
Comment 10 Neill Mitchell 2014-01-04 09:12:55 UTC
Hi. 
A quick test seems to indicate this fix works :) 

Thanks Guys.
Comment 11 MWJames 2014-01-04 15:18:21 UTC
Knowing the above fixed the apparent issue, I went ahead to remodel the implementation with some amendments.

The removal of a subject from the Store is being moved into a `DeleteSubjectJob` and if necessary can be scheduled as `DeferredJob` (enables to run deletion as background job).

Prior SMW 1.9, the subject deletion did not initiate any clean-up of possible associate subjects, the `smwgDeleteSubjectWithAssociatesRefresh` will allow to refresh entities that are connected to a deleted subject.

A subject may be connected to a large group of associates, it is advisable that `smwgDeleteSubjectAsDeferredJob` is set TRUE in order to avoid any performance issues (or runtime errors) during the deletion process.

In case the deletion is executed as `DeferredJob` it is suggested that the JobQueue is being run repeatedly within a narrow time frame to avoid an increased backlog.

### Legacy (default) setting
$GLOBALS['smwgOnDeleteAction'] = array(
	'smwgDeleteSubjectAsDeferredJob' => false,
	'smwgDeleteSubjectWithAssociatesRefresh' => false,
);
Comment 12 MWJames 2014-01-04 15:24:08 UTC
(In reply to comment #10)
> Hi. 
> A quick test seems to indicate this fix works :) 
> 
> Thanks Guys.

Please try to pull the new changes from [1] and adopt your LocalSettings with [2] in order to enable the refresh related entities. You may set `smwgDeleteSubjectAsDeferredJob` true or false depending on your local infrastructure.

If `smwgDeleteSubjectAsDeferredJob` set true then only after the JobQueue is finished a subject will be removed from Store together with an update/refresh of related properties and subjects.

[1] https://github.com/SemanticMediaWiki/SemanticMediaWiki/tree/bug

[2] $GLOBALS['smwgOnDeleteAction'] = array(
    'smwgDeleteSubjectAsDeferredJob' => true,
    'smwgDeleteSubjectWithAssociatesRefresh' => true
);
Comment 13 Jeroen De Dauw 2014-01-04 22:39:19 UTC
Merged.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links