[Moin-user] isStandardPage() returns true on deleted pages

Nir Soffer nirs at actcom.net.il
Tue Oct 25 01:34:08 EDT 2005


On 25 Oct, 2005, at 10:00, Gisbert Amm wrote:

> The isStandardPage() method of the PageEditor object returns "true" on 
> deleted pages. The reason is probably that the page directory in the 
> filesystem remains when a page is deleted (why?).

Because the deleted page is a standard page.

>
> Is this the intended behaviour? I'd rather consider it a bug.

Yes, I don't consider it as a bug.

>
> I want to create a page only if it doesn't exist. This is also the 
> case if the page has been deleted before: it is not visible from the 
> UI any more.
> When I use the exists() method of PageEditor all works like expected. 
> However, the docstring of the exists() method states that I should 
> rather use the higher level method isStandardPage().

The isStandard or isUnderlay are easier to use if you want to know if a 
page is a standard page or underlay page. If you want to know if a page 
exists, use exists.


The strange behavior, returning True for deleted page, is cause by the 
delete implementation, which does not delete the page, and even does 
not make its name free, so you can't rename another page to that name. 
Some developers prefer this behavior. I think that moving a deleted 
page to a trash directory is a better solution. In this case, after you 
delete a page, isStandardPage will return False.


Best Regards,

Nir Soffer





More information about the Moin-user mailing list