Closed (fixed)
Project:
Realistic Dummy Content
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Jan 2018 at 09:58 UTC
Updated:
25 Jun 2020 at 19:29 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #2
drugan commentedComment #3
drugan commentedComment #5
alberto56 commentedHi, thanks for the report, and the patch.
Note that you have filed this against 8.x-1.x, but 8.x-2.x is the supported branch. Can you please confirm you are using the supported version and set it in the issue information? Please re-trigger the test as well. You can also, if you are comfortable doing so, create a pull request against https://github.com/dcycle/realistic_dummy_content/tree/8.x-2.x (and reference it here) which will trigger more detailed tests.
Also, I would like to confirm why this happens and add that scenario to my automated tests -- if you know what type of field and data caused this can you please specify it here?
Thanks!
Comment #6
drugan commentedWell, I am not sure, because what I did is the following:
Go to https://www.drupal.org/project/realistic_dummy_content/git-instructions and choose 8.x-2.x branch to clone.
Make changes and then the patch:
git diff > 2938241-2.patchUploaded the patch then reset the changes and did this:
Comment #7
drugan commentedPR: https://github.com/dcycle/realistic_dummy_content/pull/18
Comment #8
alberto56 commentedThanks, I'll set the version of this ticket to 8.x-2.x then. I also started an automated test on Circle CI at https://circleci.com/gh/dcycle/realistic_dummy_content/115 to see if your patch breaks anything.
Are you using this in conjunction with any custom code, or just out of the box?
Comment #9
drugan commentedI am trying to extend "DevelGenerate" plugin to generate Drupal Commerce entities, particularly products. Again, I am not sure but for me it seems that the error emitted because GenerateProducts.php plugin instance is just a stub and does not return anything for now. However, for me it seems that the RDC module should not react for such a case even if some module makes an erroneous or incomplete "DevelGenerate" plugin's implementation. Moreover, the error arises while generating content, not product entities.
BTW, your module is great and I have a thought to recommend it for using along with the Commerce Generate module. There is only one minor issue which I discovered. When I try to generate content (Articles) it does not make more than 15 nodes and gives the server 60 seconds timeout error. I've looked into the code but got a bit confused as D7 and D8 code is intermingled and difficult to sort out (at least for me personally). Did you think about separating code bases? Please, though as a proof of concept it looks great but in a practical sense it just makes things overcomplicated without any necessity for it.
Comment #10
alberto56 commentedThanks for the detailed info and I'm glad you're finding the module useful.
Agreed. However before the patch, I am assuming that value is either an array with the key 'set', or a string. Assigning $value to be the value of $value['set'] might cause some other problems because perphaps $value is already an array, just not having the key 'set'. Then we'd end up with something like ['set' => [some random array], which might break something else.
Instead, how about something like:
That way we're not completely breaking but we're not trying to do something with invalid data.
I love that idea, and would love to be posted about the progress of that project. If it's open source, you might want to paste the repo URL here.
I think that is because of #1242352: Don't hard code the 50 node threshold for triggering batch node generation; one way around this is to only use drush, not the GUI, that works for me.
Yeah I tried that just to see if it's possible, plus I don't have the resources to maintain two versions (7 and 8) of realistic dummy content, so it sounded like a good idea... at the time, but I agree it's overly complex. If you have any patches you'd like to submit which do not fit in the "universal code" setup, I'd be glad to tweak them. If you'd like to open an issue discussing separating the two codebases, please do. Please note, though, that although I agree it's overly complex, some complexity is still needed just to make the code unit-testable as well.
Comment #11
drugan commentedYes, you're right there the data should be checked if it is the array which has expected structure. Otherwise the error should be emitted to warn a user that something is wrong.
As for the threshold issue I've fixed this on the Commerce Generate module (submodule of the Commerce Bulk) by exposing this configuration to a user on the plugin settings form. Environments are different, products also might have a huge volume so let user to decide when to start batch process or make it in one go. See more how it is done in code:
http://cgit.drupalcode.org/commerce_bulk/tree/modules/commerce_generate/...
Comment #12
alberto56 commentedThis is failing at https://circleci.com/gh/dcycle/realistic_dummy_content/116 with "Illegal string offset 'set' Drupal8.php:247"
I think it's because we need to keep these lines:
Feel free to modify your pull request at https://github.com/dcycle/realistic_dummy_content/pull/18 directly, that should now trigger tests on Circle CI.
Thanks also for the link to your code, I've often needed to generate content for Drupal Commerce. When it's ready I'll link to it in the Realistic Dummy Content home page.
Comment #13
drugan commentedI've looked into the test results and think that the whole reason is much more complex than just changing the if() condition. This code requires deeper debugging and I'll do it as soon as I have time for this. For now this and threshold issues are keeping me out from adding RDC to "suggest" section in the Commerce generate module's composer.json. Having realistic images and textual content is vital for commerce products. Also, I think that CG might be used in conjunction with RDC not only for dev purposes but also for bulk generating of products which could be used for realistic :) sale. Why not? Just think of it: you'd made some simple preparation work (according instructions in the docs) and then get a ton of ready to sale products by pressing a button only once! *dreaming...
Of course, this requires a lot of coding and testing.
Comment #15
alberto56 commentedThis is now passing tests so I have included it here.