I am running in the following error.
I have a collection of objects which I am displaying in a grid.
When this collection of objects (pages) is larger then 1, everything is fine (ex http://memoriestoriche.it/en/categories/other/altro). When the collection is just 1, PHP returns me the following error if I try to echo $item->title()
Call to a member function title() on string
If I var_dump the first item in the collection of more then 1, this is what I get:
object(Page)[364]
public 'title' => string 'marche_macerata_impiegati-e-assenteismo_antico-manifesto_inusuale_rarita_1849' (length=77)
public 'id' => string 'collezione/M/marche-macerata-impiegati-e-assenteismo-antico-manifesto-inusuale-rarita-1849' (length=90)
public 'uid' => string 'marche-macerata-impiegati-e-assenteismo-antico-manifesto-inusuale-rarita-1849' (length=77)
public 'slug' => string 'marche-macerata-impiegati-e-assenteismo-antico-manifesto-inusuale-rarita-1849' (length=77)
If I var_dump the first item in the collection of just one (which returns the error), I get a similar object:
object(Page)[524]
public 'title' => string 'interessante-tavolino-depoca_smontabile_originale' (length=49)
public 'id' => string 'collezione/I/interessante-tavolino-depoca-smontabile-originale' (length=62)
public 'uid' => string 'interessante-tavolino-depoca-smontabile-originale' (length=49)
public 'slug' => string 'interessante-tavolino-depoca-smontabile-originale' (length=49)
How come, even if both are object(Page), I can access one $item->title(), but not the other one?