Jump to content

have DB error with de/installing modules in fresh Install


horst
 Share

Recommended Posts

I have done a fresh install of PW 2.5.3 Classic-Profile, copied and installed 3 modules (that belong together) into the site/modules directory

and installed them.

I haven't done anything other, only refresh the modules cache by hitting a few times the refresh button in the modules section.

After that I have deinstalled those modules and hitted the refresh a few times.

Now after that, when I want to install them again, I get that error for the third of it:

Unable to install module 'ProcessCropImage': SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'image-crop-3' for key 'name_parent_id'

The module want to install a process admin page called 'image-crop' but without the '-3' suffix. ??

I have dumped the DB after the install and the uninstall of the modules, the only difference showing are here:

with modules, in table modules:

	(155, 'ProcessRecentPages', 1, '', '2014-10-06 15:39:35'),
	(165, 'FieldtypeCropImage', 0, '', '2014-10-06 16:18:15'),
	(166, 'InputfieldCropImage', 0, '', '2014-10-06 16:18:15'),
	(167, 'ProcessCropImage', 1, '', '2014-10-06 16:18:15');
/*!40000 ALTER TABLE `modules` ENABLE KEYS */;
without modules, in table modules

	(155, 'ProcessRecentPages', 1, '', '2014-10-06 15:39:35');
/*!40000 ALTER TABLE `modules` ENABLE KEYS */;

Also the table 'caches' is different. But everything looks ok. Also I cannot find the string 'image-crop-3' in the dump(s).

I can provide the dumps or informations of the modules if necessary or do further investigation, but actually I have no clue how and what I should do with it.

Link to comment
Share on other sites

Hey horst - sounds like we are both having similar issues at the moment :)

I had the same thing yesterday and it was just about properly removing the admin page on uninstall. Not sure how you have set up the page, but this worked for me:

$moduleID = $this->modules->getModuleID($this);
$page = $this->pages->get("template=admin, process=$moduleID, name=" . self::adminPageName);

That works based on defining this constant early on:

    /**
     * Name used for the page created in the admin
     *
     */
    const adminPageName = 'table-csv-export';
  • Like 2
Link to comment
Share on other sites

Thanks Adrian!

Now I know what was going on. :)

I have had this code, what was working before:

$p = $this->pages->get(3)->children()->get('name=image-crop');

and then I have broken it at the children() part, because in the install-routine when the adminPage gets created, I have set the page to hidden. So a simple 'include=all' or 'include=hidden' as selector for the children() will make it work again.

Hhm, I love it when I get to know why / how things do work the way they do. :)

PS: yes it seems there is much similarity between our works at the moment. :)

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...