When I enable the Pokemon Content Type and the Pokéapi - Pokemon in Drupal 8, I get a white page with the message "No more pokemon left"

Possibly $pokemon_data is returning empty. I'm still learning drupal 8 so I'll see if I can help further debug the issue.

Also maybe instead of using the die() function you could use drupal_set_message() to add a better user experience.

Comments

sgtsaughter created an issue. See original summary.

darol100’s picture

@sgtsaughter,

What version of Drupal 8 are you running ?

Try to install Pokemon Content Type first and then install Pokéapi - Pokemon. This is my first time playing with D8 modules so I do not know, how or why did not work the import.

Also maybe instead of using the die() function you could use drupal_set_message() to add a better user experience.

The reason why I was using "die" I build this first on PHP then I ported to Drupal and I forgot to make that Drupal friendly.

darol100’s picture

If you are trying this out again, you will need to uninstall the module because this will happen on the hook_install level.

darol100’s picture

Adding a relate issue to replace the die() function with the drupal message.

darol100’s picture

darol100’s picture

Status: Active » Closed (cannot reproduce)

When I enable the Pokemon Content Type and the Pokéapi - Pokemon in Drupal 8, I get a white page with the message "No more pokemon left"

I cant reproduce this, on a D8 RC1 fresh install I install those to modules and I did not have any problems with importing the data.

Also maybe instead of using the die() function you could use drupal_set_message() to add a better user experience.

This have been address on D7 and D8 version.

Closing this issue because I could not reproduce.

sgtsaughter’s picture

What is the expected result after the import? Should I have 719 nodes of the Pokemon Content Type? I am receiving the error "No more pokemon left" and I don't have any nodes created. I had tried this on D8 RC-1 now I have just tested this on a fresh install of D8 RC-2.

darol100’s picture

@sgtsaughter,

This morning I test it out on RC2 on fresh install and did not export if you enable both of them at the same time. I had to enable the pokemon_content_type wait until import the Pokemon content type and then enable the pokeapi_pokemon and this will import generate nodes base on the fields in the content type.

Should I have 719 nodes of the Pokemon Content Type?

Yes

Here is the output that you should see in your content page (admin/content):

This is an example of the Bulbasaur node: