State Field Type Name Not Showing in Module

sumentuten - 4 months ago

Hi, I created a module which inputs a location name and the state (PH cities). For the table builder I added a state colum to show the state name ie. Davao City, Davao del Sur and not the state code. So I set the table column from "city" to entry.city.name" but nothing appears in the table. What can I do to have the name appear instead of the code?

piterden - 4 months ago

First of all it would be nice to look at your migrations config for that module. Also it'd be not bad if you'll show Presenter of that entity.

sumentuten - 4 months ago

Here is my migrations for the module:

<?php

use Anomaly\Streams\Platform\Database\Migration\Migration;

class RapidustechModulePartnerOutletsCreatePartnerOutletsFields extends Migration {

/**
 * The addon fields.
 *
 * @var array
 */
protected $fields = [
  'name' => 'anomaly.field_type.text',
  'address' => 'anomaly.field_type.textarea',
  'city' => [
      'type' => 'anomaly.field_type.state',
      'config' => [
        'countries'     => ['PH'],
        'mode'          => 'dropdown'
      ]
    ]
];

}

The presenter for this entity is empty, haven't been doing anything with that yet. Is there something I should be doing here to get the result that I want?

piterden - 4 months ago

Please, read the docs https://pyrocms.com/documentation/streams-platform/v1.1#database/migrations That what you show me, is not enough for migrations to work correctly!

ryanthompson - 4 months ago

Can you share a screenshot of what you are seeing exactly? Have you added the data to the configuration for streams cause I doubt those are in there already.