您现在的位置是: 首页 > 后端开发 Nestedset 出现 Node must exists. 错误解决方案
Nestedset 出现 Node must exists. 错误解决方案
2020-05-20 【后端开发】 3026人已围观 6401次浏览
简介Nestedset 出现 Node must exists. 错误解决方案
在使用Nestedset多级无限分类插件时,保存或修改分类数据时出现Node must exists.报错,通过查看文档发现是左右值数据被污染,需要通过自带的fixTree();方法来进行修复
首先通过
php artisan tinker
打开console控制台
然后执行
MyModel::fixTree();
MyModel对应的就是你自己项目中的Model类。
等待执行完成后,控制台会返回受影响的条目数,这时候再去数据库中查询当前表的数据,就已经是修复成功后的数据。
再次执行分类的增删改就没有问题了
出现此类错误的原因一般是在刚启用Nestedset时,数据库中对应的_lft和_rgt字段数据有问题,或者是直接修改数据库中数据导致的结构树被污染。
执行fixTree() 修复即可
很赞哦! (0)
相关文章
- SpringBoot 启动测试时出现提示 Test class should have exactly one public zero-argument constructor
- SpringBoot 2.x 文件上传出现 The field file exceeds its maximum permitted size of 1048576 bytes
- PHP 中list()出现Undefined offset: 0错误
- SqlServer 优化技巧
- RocketMQ 出现 sendDefaultImpl call timeout 问题
- 记一次Java MessageFormat.format踩坑
- SpringBoot 定时任务 多线程
- PHP 在执行 composer install 时出现提示 PHP Fatal error: Allowed memory size of XXXXXX bytes exhausted <...>
- SpringBoot 2.x Security security.basic.enabled=false 失效问题解决
- Laravel Dingo/api 出现 The version given was unknown or has no registered routes.报错
点击排行
- Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: ERR DISABLE You can't write or read against a disable instance
- Debian apt 使用国内镜像
- RocketMQ 出现 sendDefaultImpl call timeout 问题
- 类 BASE64Decoder 程序包 sun.misc 找不到符号
- SpringBoot @NotBlank 不生效问题
- 记一次 Mybatis-Plus 自动填充无效问题解决
- SpringBoot 2.x 文件上传出现 The field file exceeds its maximum permitted size of 1048576 bytes
- nuxt 项目完整部署方案
站长推荐
猜你喜欢
- gulp3 在 node12 上运行出现异常 primordials is not defined
- 解决Lost connection to MySQL server at 'reading initial communication packet' 的方法
- 【代码片段】MySQL 查看数据库所有表注释
- Linux 服务器之间传输大文件(压缩文件、查看MD5、后台传输)
- nginx 出现 the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in 错误解决方案
- LNMP 手动更新 SSL 证书
- layUI点击按钮页面刷新问题解决方案
- docker mysql 导入 SQL 脚本
- linux下各文件夹的结构说明及用途介绍
- Debian apt 使用国内镜像