Cannot call get with undefined key / Post.get is not a function

On my local machine I am using the latest version of Discourse. When I attempt to add a reply within a topic, I get the following error message:

The post.get error occurs in this bit of code:

I did a console.log(post) to see what it contained and the result was an object that has a post number of (...) . EDIT: Clicking on (…) yielded 1.

Additionally, when I try to add a New Topic (within the pipeline or in a topic), I get the error:

Would anyone know how to rectify this? Thanks!

Are you sure post is an Ember object? Have you tried post.post_number?

Isolated it down to something in two of our plugins, both of which reopen the composer controller.

Nel mio ambiente di sviluppo locale, mentre lavoro su un plugin, riscontro un comportamento altrettanto strano in relazione a Composer.

Il pulsante “Crea argomento” funziona nella mia istanza locale di Discourse, ma se provo ad aggiungere un altro pulsante “Crea argomento” in un’altra posizione (e aggiungo del codice per farlo funzionare), si crea un problema: tutti i pulsanti “Crea argomento” in tutto il sito (locale) smettono di funzionare.

Inoltre, ricevo questo errore:

Uncaught Error: Assertion Failed: The key provided to set must be a string or number, you passed undefined

Questo problema persiste anche se rimuovo il codice che sembrava aver causato l’errore inizialmente. Cioè, una volta che si verifica questo errore, anche se ripristino tutto il codice com’era prima, l’errore continua a presentarsi ogni volta che provo a cliccare sul pulsante “Crea argomento”.

L’unica cosa che, credo, fa scomparire l’errore è rimuovere completamente il file in cui era stato inserito il nuovo codice (quindi, se il file non c’è, tutto funziona; se il file c’è ma è vuoto, l’errore persiste).

Qualcuno ha qualche idea su cosa possa essere? Questo problema ha rappresentato un grande ostacolo al mio sviluppo.