Closed (fixed)
Project:
Translation Management Tool
Version:
7.x-1.x-dev
Component:
Demo / Simplytest.me
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
19 Jul 2013 at 12:14 UTC
Updated:
2 May 2014 at 10:11 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
cgalli commentedThis patch adds tmgmt_demo module. It sets up all necessary elements for a demo site.
By simply activating the 'Translation Management Core' module, all other needed modules are activated and settings and contents added.
Not yet tested with simplytest.me, as the patch is not yet up on d.o (it will be in a few minutes)
Comment #2
cgalli commentedhere ist the patch....
Comment #3
cgalli commentedIt does work on simplytest.me :-)
The url is: http://simplytest.me/project/tmgmt/7.x-1.x?patch[]=https://drupal.org/fi...
It takes a while to launch...
Comment #4
miro_dietikerGreat to see progress here! Some first review.
I don't think this dependency direction was the idea.
Not hidden yet as suggested.
This is executed for every module enable completion. Later module enables might result in content duplicates added. May be add an early exit against multiple runs.
MS? ;-) I see, this seems comfortable. But i guess it's against M$ license agreements to publish private keys.
Also missing install of the local translator.
How about using devel_generate? Not sure. But i guess we need more example cases.
Comment #5
cgalli commented1) This is the only way to trigger the installation and activation of tmgmt_demo on Simplytest.me. If we want a ready-to-use demo system there, we need to make the patch self starting.
2) There is no need to ever load this module onto d.o. So no manual installation/activation is possible. Hiding is still an option, but no requirement.
3) This only gets triggered after installing 'locale'. How could it be executed multiple times?
4) Including Local Translator as a dependency breaks the installation, resulting in multiple notices. I do not understand why....(any suggestions?) Also, LT requires much more guidance for the casual demo user to understand.
5) Somebody told me the other day that users need real text to relate to the system.....
Comment #6
miro_dietikerIn re...
> 1) This is the only way to trigger the installation and activation of tmgmt_demo on Simplytest.me. If we want a ready-to-use demo system there, we need to make the patch self starting.
Thought you can pass to them to enable tmgmt_demo on install. See link.
> 2) There is no need to ever load this module onto d.o. So no manual installation/activation is possible. Hiding is still an option, but no requirement.
This module also should never be enabled in production, so we don't it to show up in module list.
> 3) This only gets triggered after installing 'locale'. How could it be executed multiple times?
It's hook_module_installed. It gets executed after each module install: https://api.drupal.org/api/drupal/modules%21system%21system.api.php/func...
If you want to limit it to locale, i would suggest an early exit.
> 4) Including Local Translator as a dependency breaks the installation, resulting in multiple notices. I do not understand why....(any suggestions?) Also, LT requires much more guidance for the casual demo user to understand.
I see, there are multiple approaches: testing only a simple/reduced setup VS testing extended features / anything possible. With DSB we name this "scenarios" and have different cases to address. With this approach we either would need multiple submodules for each scenario or even choose the install profile approach.
> 5) Somebody told me the other day that users need real text to relate to the system.....
Fully agree that gibberish adds complexity. Is there anything like wikipedia generate? (or should we use wget? is wget even allowed in simplytest.me?!) ;-)
Comment #7
berdir1) The problem with that is that it results in a weird dependency tree, the core module shouldn't depend on the demo module that provides content for it. Have you tried a module_enable(array('tmgmt_demo')) in tmgmt_install() ?
2. Yes, we want to add it :). This could for example also be interesting if you set up a development environment to work on TMGMT. That's why it needs to be hidden, so that you can only do it through drush en. Then the only thing the patch would need to do is add the snippet that enables it automatically.
3. Yes, it is wrapped, but there's no guarantee that locale and microsoft translator are installed at the same time, so this is tricky. if the module_enable() works, you could use hook_install() and wouldn't have to worry about modules, you'd just specify what you need.
4. Yep, keys are problematic. If you think the local translator is too hard to grasp, then that's a problem of the local translator and we should fix it :). I don't think it's that bad if there's some initial configuration for the languages etc. Eventually, there could be a few that we could include, some work out of the box (we could provide a drupal translator against our sandbox server) others need configuration. That's imho ok if there's no way around it. At least we shouldn't do it without checking with them.
Comment #8
berdir@Miro:
1) No, you can only pass *projects*, not multiple modules within the same project. So it would only work if we set it up as a separate project.
3) As discussed, the check is there but a bit confusing, being able to use hook_install() would be much easier.
Comment #9
cgalli commented3) Using hook_install in tmgmt_demo not only results in notices but completely crashes the system (resulting in everything but tmgmt core enabled...). Will try the path of module_enable combined with hook_install
Comment #10
patrickd commentedPlease use one of the following .info directives to enable a module on simplytest.me programatically:
I updated the documentation page according to that info.
You can find this and more at the Questions and Answers section of simplytest.me: http://simplytest.me/qa#developers
Comment #11
patrickd commentedI just re-read my own documentation and realized that these directives only fetch the specified dependencies and don't install them. (stupid me, sorry!)
But that's (obviously) not very intuitive: change request here: #2116901: Not only fetch, but also enable recommended / demo dependencies
Comment #12
cgalli commentedInitial patch to test simplytest_dependencies[]
Demo module is not yet hidden, so we can turn it on manually on testing site.
Core and Demo must be turned on one at a time.
In simplytest.me, demo should be enabled by the sandbox.
Comment #13
cgalli commentedDid not work.
An error occurred while patching the project. says simplytest.me
Any idea?
Comment #14
miro_dietikersidenote cgalli: with drush you can also enable hidden modules.
Comment #15
berdirRe-roll without the dpm() call in there (that can't work as you don't install devel), also fixed windows line endings.
Comment #16
berdirLooks like hook_install() doesn't work somehow, it works if you re-install it manually.
@Miro: Yeah... but you don't have drush on simplytest.me ;)
Comment #17
berdirAnother version that doesn't do the install stuff conditional but with hook_install().
Comment #18
berdirYeah, no luck with all of those, re-opened the simplytest.me issue.
Comment #19
cgalli commentedThe same thing happens in manual install. When enabling/installing Core and Demo at the same time, the hook_install does not seem to be invoked. When enabling them in sequence (Enable core, save, enable demo save), it works.
Comment #20
berdirOk, found it, we need to manually include locale.inc.
Comment #21
miro_dietikerGreat work, guys. Works for me as a very basic setup.
However, note that in #2 cgalli already did more like create some basic nodes that reduce clicking to create a first job.
Also translators are no more setup.
Will we need some helper node / block that explains the required/recommended steps?
(all followup?)
Comment #22
berdirHm, yes, let's at least re-add some of that. The node body could be used as a place to put some descriptions to get started.
Comment #23
cgalli commentedI will take care of that.
Comment #24
cgalli commented- Adapted demo to use the local translator and xliff only.
- Added the demo content back, could not find a reasonable source for dummy content.
- The uninstall hook does not run through, I do not understand why. Please advise.
- The module is not hidden yet for testing purposes.
Comment #26
berdirThis is a new test that went in a while ago and had the same test fail initially, not related to this...
Comment #27
blueminds commenteddebugging broken test
Comment #29
blueminds commentedProblem is in the order of jobs. The test expects the tested job to be in the second position in the list, which is not always true during tests. Rewrote the xpath to search for the expected text and not to rely on the order.
Comment #30
berdirFixed a few bugs, now it actually works.
Adding language skills to user 1 instead of current user, current user is anon if you e.g. install with drush or probably also the simplytest.me script
Uninstall had a typo, note_type_delete() :)
Comment #31
berdirNo it doesn't. My user_save() overrides the user password.
Comment #32
cgalli commentedChanged user_save(), the Login works again.
Add: The patch works correctly with simplytest.me :-)
Comment #33
berdirAwesome.
Committed and pushed, without the snippet that was already committed separately.
This works now just like this: http://simplytest.me/project/tmgmt/7.x-1.x
@cgalli: Can you update the project page/documentation and add a link to that URl so that people can try it out. There used to be a specific demo site link, I assume that still exists.
Comment #34
cgalli commentedAdjusted Documentation.
The attached patch fixes a little mistake preventing reinstallation. In addition it adds 2 specific links to the documentation.
If anybody knows how to make those 2 links open in a new tab ('TARGET = _BLANK'), please advise. It is not optimal to start a simplytest.me session just to replace it with the documentation page immediately).
Comment #35
miro_dietikerModifying the target of the link is no core feature. It requires some ugly code... .-)
The documentation links are public. I would not check for "access content" permission. Instead always deliver: TRUE.
I guess long term i would create a separate menu "Documentation" and place it in the design. Thus also remove the "Documentation for" chunks from the link title.
Also in this case it is more easy to add the target for all documentation links in the documentation menu.
Problem: You added a bugfix and a new feature into the same issue. The basic feature of simplytest.me went in with TMGMT. We usually continue in followup issues and separate the different aspects (one bug, one feature).
Comment #36
cgalli commentedFollow up Issue: #2142557: Demo Module cannot be (re)installed for the bug fix
Comment #38
miro_dietiker