Skip to content
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

[4.0] Attempting to install sample data twice #23633

Closed
C-Lodder opened this issue Jan 22, 2019 · 10 comments
Closed

[4.0] Attempting to install sample data twice #23633

C-Lodder opened this issue Jan 22, 2019 · 10 comments

Comments

@C-Lodder
Copy link
Member

Steps to reproduce the issue

  1. Install sample data via the backend
  2. refresh the page
  3. Attempt to install it again

Expected result

Either:

  1. Disable the "Install" button and change the text of it to "Installed"
  2. Completely hide the box
  3. Display a more appropriate message such as stating they've already installed it

Actual result

A red alert:

Step 1 Failed: Another category with the same parent category has the same alias (remember it may be a trashed item).

System information (as much as possible)

Additional comments

@Bakual
Copy link
Contributor

Bakual commented Jan 22, 2019

Doesn't work because we have no way of tracking which sample data is installed. Even if we would track it (in a database), we wouldn't know if the installed sample data still is the original one or if it got deleted or whatever.

The only error we can get is that the category already exists, for whatever reason (sample data already installed or category manually created with same name). And that we do.

@C-Lodder
Copy link
Member Author

C-Lodder commented Jan 22, 2019

@Bakual The sample data derives from a plugin, so is it not possible to add custom field to each XML file, for example:

<field type="foo" name="blog_sample_data_installed" value="0">

and upon installing the sample data, that parameter value be updated to 1

@Bakual
Copy link
Contributor

Bakual commented Jan 22, 2019

And what happens if the user removes the sample data manually and wants to install it again?
Or wants to install it twice in different languages (which is perfectly fine and works).

@Bakual
Copy link
Contributor

Bakual commented Jan 22, 2019

Don't get me wrong. I don't want to shoot this down. But it was discussed already when we introduced this module and we didn't find a solution that would work.

@C-Lodder
Copy link
Member Author

@Bakual ah, I was not aware that is could be installed for different languages

@joomla-cms-bot
Copy link

Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/23633

@ghost
Copy link

ghost commented Mar 4, 2019

closed on Base of Comment above.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23633.

@chmst
Copy link
Contributor

chmst commented Oct 15, 2022

In J4 users get only blog sample data. If the user tries to install again, an appropriate message appears as requested.

Display a more appropriate message such as stating they've already installed it.

Hopefully we find a better solution for J5

@brianteeman
Copy link
Contributor

Actually it is pretty easy to resolve
in the sample data add a step that unpublished the sample data plugin
or
Update the plugin code so that it can be disabled and still published then
in the sample data add a step that disables the install button of the sample data plugin

@Hackwar
Copy link
Member

Hackwar commented Nov 14, 2022

I did the modification Brian proposed in #39216. Since you can install blog and multilang sampledata multiple times, I only added this to the testing sampledata. Closing this issue since we have a PR.

@Hackwar Hackwar closed this as completed Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants