Why do I get an error when using the easyadmin search bar? - symfony

I don't understand why, only in my 'file' entity I can't use the search bar of easyadmin I have this error:
Class "string" does not exist
trace:
(line 156)
                /** #var \ReflectionNamedType|\ReflectionUnionType|null $idClassType */
                $idClassType = (new \ReflectionProperty($entityFqcn, $propertyName))->getType();
                if (null !== $idClassType) {
                    $idClassName = $idClassType->getName();
                    $isUlidProperty = (new \ReflectionClass($idClassName))->isSubclassOf(Ulid::class);
                    $isGuidProperty = (new \ReflectionClass($idClassName))->isSubclassOf(Uuid::class);
                }
            }
            // this complex condition is needed to avoid issues on PostgreSQL databases

Related

ERROR: LoadError: UndefVarError: type not defined

I am working in Julia and I'm trying to use Documenter.jl to create a documentation page for Examples.jl and I keep getting this error when I try to run my make.jl file:
ERROR: LoadError: UndefVarError: type not defined
Here is my code for the make.jl file:
using Documenter
using Examples
makedocs(
sitename = "Examples.jl",
pages = Any[
"About" => "index.md",
"Main" => "main.md",
"Graphs" => "graphs.md",
"Utilities" => "utilities.md",
"Tutorial" => "tutorial.md"
]
)
Any ideas how to fix this error? Thanks
As #Matt B. pointed out, type is no longer a valid keyword. In Julia 0.x you used to define types as:
type foo
bar
end
Now we use struct or mutable struct instead. e.g.
struct foo
bar
end
Go through your code and see if you see type anywhere.

Can't add a field to a model in Symfony, bin/console crashes

I'm working with Sylius framework. I'm following the guide to customize models.
I am trying to add a field notice to a model Taxon which is already overridden in my project. For that, I added the field description to Taxon.orm.yml of the model:
MyProject\Bundle\ShopBundle\Entity\Taxon:
type: entity
table: sylius_taxon
# {Relationships code...}
fields:
# {Some existing fields...}
notice:
type: text
nullable: true
I also added a field, a getter and a setter to the overriding Taxon class.
Then I'm trying to run bin/console doctrine:migrations:diff, but when I run bin/console even without any arguments, it crashes with the following exception:
[Doctrine\DBAL\Exception\InvalidFieldNameException]
An exception occurred while executing 'SELECT s0_.code AS code_0, s0_.tree_left AS tree_left_1, s0_.tree_right AS tree_right_2, s0_.tree_level AS tree_level_3, s0_.position AS position_4, s0_.id AS id_5, s0_
.created_at AS created_at_6, s0_.updated_at AS updated_at_7, s0_.enabled AS enabled_8, s0_.default_markup AS default_markup_9, s0_.notice AS notice_10, s0_.tree_root AS tree_root_11, s0_.parent_id AS parent_
id_12 FROM sylius_taxon s0_ WHERE s0_.parent_id IS NULL ORDER BY s0_.tree_left ASC':
SQLSTATE[42S22]: Column not found: 1054 Unknown column 's0_.notice' in 'field list'`
[Doctrine\DBAL\Driver\PDOException]
SQLSTATE[42S22]: Column not found: 1054 Unknown column 's0_.notice' in 'field list'`
[PDOException]
SQLSTATE[42S22]: Column not found: 1054 Unknown column 's0_.notice' in 'field list'
If I remove the changes to Taxon.orm.yml then bin/console works again. What is missing in my changes?
One of my bundles' configruation contained that model's repository, that's it. I temporarily deleted the bundle's configuration from config.yml, and bin/console worked.
When you add new field you should doctrine:schema:update

Edges collection undefined until _collections() operation is used

I'm using ArangoDB 3.4.2 and I have a weird problem that I'm not able to explain...
I create a graph (myGraph) in the following in arangosh:
var graph_module = require('#arangodb/general-graph');
var myGraph = graph_module._create('mygraph');
myGraph._addVertexCollection('vertexes');
var edges = graph_module._relation('edges', ['vertexes'], ['vertexes']);
myGraph._extendEdgeDefinitions(edges);
Being vertexes and edges the collections for vertexes and edges, respectively.
Now, I create two vertexes:
db.vertexes.save({"name": "A", "_key": "A"});
db.vertexes.save({"name": "B", "_key": "B"});
So far so good. But now I try to create the edge between both and I get a fail:
127.0.0.1:8529#myDB> db.edges.save("vertexes/A", "vertexes/B", {"name": "A-to-B"});
JavaScript exception: TypeError: Cannot read property 'save' of undefined
!db.edges.save("vertexes/A", "vertexes/B", {"name": "A-to-B"});
! ^
stacktrace: TypeError: Cannot read property 'save' of undefined
at <shell command>:1:9
It seems that db.edges is undefined:
127.0.0.1:8529#MyDB> console.log(db.edges)
2019-01-26T19:01:52Z [98311] INFO undefined
But now, if I run db._collections() it seems that db.edges gets defined (weird!)
127.0.0.1:8529#MyDB> db._collections()
...
127.0.0.1:8529#MyDB> console.log(db.edges)
2019-01-26T19:02:58Z [98311] INFO [ArangoCollection 16807, "edges" (type edge, status loaded)]
and in this moment, the db.edges.save(...) operation works:
127.0.0.1:8529#MyDB> db.edges.save("vertexes/A", "vertexes/B", {"name": "A-to-B"});
{
"_id" : "edges/16899",
"_key" : "16899",
"_rev" : "_YGsKKq2--_"
}
Why db.edges is undefined at the first save()? Why a show colletions operation (which I understand is read-only) is getting it defined? Maybe I'm doing something wrong?
When executing db.edges.save() an internal cache is accessed. If this cache is clear, executing db.edges.save() works to save an edge. Since db._collections() resets this cache, it is possible to run the command afterwards. However if this cache is not clear, an error is thrown as you observed.
The correct and safe way is to access the collection via db._collection("collection-name").
Therefore you can use the following command to save an edge in the edges collection:
db._collection("edges").save("vertexes/A", "vertexes/B", {"name": "A-to-B"});

FOSUser + PUGX: fatal type error in UserManager.php

After updating composer, I started getting this error
Type error: Argument 1 passed to FOS\UserBundle\Doctrine\UserManager::__construct() must implement interface FOS\UserBundle\Util\PasswordUpdaterInterface, instance of Symfony\Component\Security\Core\Encoder\EncoderFactory given
in composer.json I have following bundles:
"require":{
"friendsofsymfony/user-bundle": "~2.0#dev",
"pugx/multi-user-bundle": "3.0.*#dev",
}
Full error:
Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Type error: Argument 1 passed to FOS\UserBundle\Doctrine\UserManager::__construct() must implement interface FOS\UserBundle\Util\PasswordUpdaterInterface, instance of Symfony\Component\Security\Core\Encoder\EncoderFactory given, called in /Users/juliezhanazar/PhpstormProjects/cofico-backend/vendor/pugx/multi-user-bundle/PUGX/MultiUserBundle/Doctrine/UserManager.php on line 47 in /Users/juliezhanazar/PhpstormProjects/cofico-backend/vendor/friendsofsymfony/user-bundle/Doctrine/UserManager.php:46
try change
"friendsofsymfony/user-bundle": "dev-master#49e3117888f8ed79a10afe5f0cb7a404c13b616c"

Issue in calling Json response for the Webscript in Alfresco

I have created Json response file in Company Home > Data Dictionary >
Web Scripts > org > alfresco > sample with the Name:
folder.get.json.ftl for one of the Alfresco Web
Script(http:// localhost:8080/alfresco/service/sample/folder/Company%20Home)according
to the guidelines mentioned in
http://docs.alfresco.com/4.0/index.jsp?topic=%2Fcom.alfresco.enterprise.doc%2Ftasks%2Fws-json-add.html.
After successful addition of the webscript , i have refresh the
Webscripts.
Now when im tring to call this websrcipt using the URL
http:// localhost:8080/alfresco/service/sample/folder/Company%20Home?format=json
i am getting Internal Error(500).
Please help me out regarding this.
Thanks in Advance!!!!
Below is the stack trace
{
"status" :
{
"code" : 500,
"name" : "Internal Error",
"description" : "An error inside the HTTP server which prevented it from fulfilling the request."
},
"message" : "01270141 Wrapped Exception (with status template): 01270216 Error during processing of the template 'Expression verbose is undefined on line 12, column 14 in org\/alfresco\/sample\/folder.get.json.ftl.'. Please contact your system administrator.",
"exception" : "org.springframework.extensions.webscripts.WebScriptException - 01270141 Wrapped Exception (with status template): 01270216 Error during processing of the template 'Expression verbose is undefined on line 12, column 14 in org\/alfresco\/sample\/folder.get.json.ftl.'. Please contact your system administrator.",
"callstack" :
[
"" ,"freemarker.core.InvalidReferenceException: Expression verbose is undefined on line 12, column 14 in org\/alfresco\/sample\/folder.get.json.ftl."
,"freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:125)"
,"freemarker.core.Expression.isTrue(Expression.java:145)"
,"freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:77)"
,"freemarker.core.Environment.visit(Environment.java:221)"
,"freemarker.core.MixedContent.accept(MixedContent.java:92)"
,"freemarker.core.Environment.visit(Environment.java:221)"
,"freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:179)"
,"freemarker.core.Environment.visit(Environment.java:428)"
,"freemarker.core.IteratorBlock.accept(IteratorBlock.java:102)"
,"freemarker.core.Environment.visit(Environment.java:221)"
,"freemarker.core.MixedContent.accept(MixedContent.java:92)"
,"freemarker.core.Environment.visit(Environment.java:221)"
,"freemarker.core.Environment.process(Environment.java:199)"
,"org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:202)"
,"org.springframework.extensions.webscripts.AbstractWebScript.renderTemplate(AbstractWebScript.java:714)"
,"org.springframework.extensions.webscripts.DeclarativeWebScript.renderFormatTemplate(DeclarativeWebScript.java:267)"
,"org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:147)"
,"org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:400)"
,"org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:388)"
,"org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:453)"
,"org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:491)"
,"org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:316)"
,"org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:352)"
,"org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:189)"
,"org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:118)"
,"javax.servlet.http.HttpServlet.service(HttpServlet.java:717)"
,"org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)"
,"org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)"
,"org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:58)"
,"org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)"
,"org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)"
,"org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)"
,"org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)"
,"org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:465)"
,"org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)"
,"org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)"
,"org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)"
,"org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)"
,"org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)"
,"org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)"
,"org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555)"
,"java.lang.Thread.run(Thread.java:619)"
,"org.alfresco.service.cmr.repository.TemplateException: 01270216 Error during processing of the template 'Expression verbose is undefined on line 12, column 14 in org\/alfresco\/sample\/folder.get.json.ftl.'. Please contact your system administrator."
,"org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:206)"
,"org.springframework.extensions.webscripts.WebScriptException: 01270141 Wrapped Exception (with status template): 01270216 Error during processing of the template 'Expression verbose is undefined on line 12, column 14 in org\/alfresco\/sample\/folder.get.json.ftl.'. Please contact your system administrator."
,"org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:884)"
],
"server" : "Community v4.0.0 (a r30055) schema 5,016",
"time" : "Feb 27, 2012 9:53:23 AM"
}
The key line is:
freemarker.core.InvalidReferenceException: Expression verbose is undefined on line 12, column 14 in org/alfresco/sample/folder.get.json.ftl.
Your template, on line 12, character 14, you've referenced a variable "verbose" which doesn't exist. You should either set that variable in the model, or check if it's defined or not before using it.

Resources